Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PacRat ( platformer Beta )
#1
This game is still in the start phase. Large games take me a long time, I tend to forget what I did the day before.
 
  It uses a wide screen format that fits my laptop and a virtual screen of about 3000 pixels wide.

  What takes me so long, is the fact that when I fix a bug, I often create 2 more. It takes a lot of logic to keep an icon from moving into  walls.

Code:
'  By Rick3137    http://rb23.yolasite.com/
'  You have permission to copy, paste, alter or post anywhere as long as you don't copyright my work.
'  If it breaks your computer or does damage to your health or wealth , I didn't do it.
'  If you repost this material to another website like Utube, please make changes to the content and name so no one gets confused.

visible:
 sq1 =0 ;  row = 0 ; column = 0 ;  jump = 0 ; fall = 0 ; dir = 1 ; dbm = 0 ; dbm2 = 0
 move = 0 ; px = 0 ; py = 0 ; columnx = 0 ; cx = 0 ; rowy = 0 ; ry = 0 ; dx = 0 ; dy = 0
 zx;zy; cnt1 = 60 ; xoffset = 0 ; yoffset = 0
 
 clr?[60]
create image 1,4000,4000
create image 2,50,50

 a0[]  = [ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 ]  
 a1[]  = [ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 ]  
 a2[]  = [ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 ]
 a3[]  = [ 1,1,1,1,1,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1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0,0,0,0,0,0,0,0,0,1 ]
a27[]  = [ 1,0,0,0,1,1,1,1,1,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 ]
a28[]  = [ 1,0,0,0,1,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 ]
a29[]  = [ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 ]
a30[]  = [ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 ]

 aa[31][60]
for a = 0 to 59
  aa[0][a] = a0[a] ;aa[1][a] = a1[a] ;aa[2][a] = a2[a] ;aa[3][a] = a3[a] ;aa[4][a] = a4[a] ;aa[5][a] = a5[a] ;aa[6][a] = a6[a] ;aa[7][a] = a7[a] ;aa[8][a] = a8[a] ;aa[9][a] = a9[a]
  aa[10][a] = a10[a] ;aa[11][a] = a11[a] ;aa[12][a] = a12[a] ;aa[13][a] = a13[a] ;aa[14][a] = a14[a] ;aa[15][a] = a15[a] ;aa[16][a] = a16[a] ;aa[17][a] = a17[a] ;aa[18][a] = a18[a] ;aa[19][a] = a19[a]
  aa[20][a] = a20[a] ;aa[21][a] = a21[a] ;aa[22][a] = a22[a] ;aa[23][a] = a23[a] ;aa[24][a] = a24[a] ;aa[25][a] = a25[a] ;aa[26][a] = a26[a] ;aa[27][a] = a27[a] ;aa[28][a] = a28[a] ;aa[29][a] = a29[a]
  aa[30][a] = a30[a]  
next
set redraw off
hidden:
  proc MakeSquare
  proc DrawMaze
  proc images

set window 0,0, 1366, 768, 1
 
     proc loop1
 
 
end
hidden:

procedure Setup()

endproc

procedure DrawMaze()
  set image 1
       set color 0,0,150
     ' Draw horizontal lines
     for a = 1 to 30
      draw line 1, 50*a, 3000, 50*a
     next
        set color 0,0,150
        ' Draw vertical lines
     for a = 1 to 60
        draw line 50 * a, 1, 50 * a, 3000
     next
    a = 0 ; b = 0
    set color 255,255,255
    for a = 0 to 59
      ' Draw 50x50 blocks
      ' X axis
      for b = 0 to 30
        ' Y axis
        if aa[b][a] = 1 then draw image 2, a * 50,b * 50
      next
     
    next
    set image primary

endproc

procedure MakeSquare()
  set image 2
        set color 0,0,245
        draw rect 1, 1,49,49,1
        set color 255,255,255
        draw rect 1, 1,49,49,0
        set color 255,0,0,600
     for a = 2 to 49
         draw line 2,a,48,a
         draw line a,2,a,48
         a = a + 4
     next

endproc



procedure loop1()
    ch = 0 ; zx = 0 ; zy = 0 ; px = 300 ; py = 150 ; dir = 1 ; cnt = 0 ; move = 0
    set color 255,255,255
    draw image 1,zx,zy
   
  set image colorkey 6,1  
  set image colorkey 4,1
  set image colorkey 5,1
 
  while ch <> 27
    if row = 14 and fall = 1 and dy = 49
         yoffset = 785
    endif
    if row = 14 and jump > 0 and dy = 49
         yoffset = 0
    endif
    if column = 20 and dir = 1 and dx = 49
         xoffset = 950
         move = 0
    endif
    if column = 20 and dir = 2 and dx = 49
        xoffset = 0
        move = 0
    endif


    if column = 40 and dir = 1 and dx = 49
         xoffset = 1640
         move = 0
    endif
    if column = 40 and dir = 2 and dx = 49
          xoffset = 950
          move = 0
    endif    
   

    column = px / 50
    row = py / 50
    columnx = column * 50
    rowy = row * 50
    cx = columnx + 50
    ry = rowy + 50
    dx = px - columnx
    dy = py - rowy
   
    if jump > 0    
        py = py - 1
        jump = jump + 1
              column = px / 50
              row = py / 50

    endif
     ' limit of jump
    if jump > 160
       jump = 0
       fall = 1
     
    endif
    ' stop fall if object hits floor
    if fall = 1 and jump = 0 and aa[row+1 ][column] = 1  and dir = 1 and dx = 0  
       fall = 0
       dbm = 1
    endif
    if fall = 1 and jump = 0 and aa[row+1 ][column+1] = 1  and dir = 1 and dx > 0  
       fall = 0
       dbm = 1
    endif
    if fall = 1 and jump = 0 and aa[row+1 ][column] = 1  and dir = 2
       fall = 0
       dbm = 2
    endif    
    ' fall some more if not at floor
    if  aa[row + 1][column] = 0 and py < 701 and jump = 0 and fall = 0 and py > 60  
            fall = 1
            dbm = 3
    endif
     ' stop if moving right and hitting top of wall

    if aa[row+1 ][column+1] = 1  and aa[row+1 ][column] = 0 and dir = 1 and move = 1  
       move = 0
       fall = 1
       dbm = 4
    endif
    ' stop fall at top of wall while moving right
    if fall = 1  and aa[row+1 ][column+1] = 1  and dir = 1 and move = 1  
       fall = 0
       dbm = 5
    endif
     ' stop fall if hitting floor while moving right
    if fall = 1  and aa[row+1 ][column] = 1  and dir = 1 and move = 1
       fall = 0
       dbm = 6
    endif

      ' stop fall if hitting floor while moving left
    if fall = 1  and aa[row+1 ][column] = 1  and dir = 2 and move = 1
       fall = 0
       move = 0
       dbm = 7
    endif
       ' Should we fall? ( moving right )  
    if move = 1 and dir = 1 and aa[row + 1][ column ] = 0 and aa[row + 1][ column + 1] = 0  and jump = 0
        fall = 1
        dbm = 8
    endif
       ' fall moving left
    if move = 1 and dir = 2 and aa[row + 1][ column ] = 0  and jump = 0 and fall = 0 and dx = 10
       fall = 1
       move = 0
       dbm = 9
     
    endif
       ' moving left and falling, stop moving left at wall

    if move = 1 and dir = 2 and aa[row ][ column-1 ] = 1 and fall = 1 and dx = 1  
        mov = 0
       
        dbm = 10
    endif
       ' adjust fall at wall
    if fall = 1 and dir = 2 and move = 0 and dx = 1
       px = px - 1
    endif
       ' stop at wall while moving left and falling
    if move = 1 and dir = 2 and aa[row + 1][ column ] = 0 and aa[row ][ column - 1] = 1  and fall = 1  and dx = 0
       move = 0
       fall = 0
       dbm = 11
    endif
       ' no falling if wall on right and dir = 1
    if fall = 1 and aa[row + 1][ column + 1 ] = 1 and dx > 0 and dir = 1
        fall = 0
        dbm = 12
    endif

       ' Make fall
    if fall = 1 then py = py + 1

       ' Stop horizontal movement at wall (while walking on floor)
 
       if move = 1 and dir = 1 and aa[row][ column + 1] = 1 and dx = 0 and jump = 0 and fall = 0
           move = 0 ; px = px - 1
           dbm = 13
       endif

       if move = 1 and dir = 2 and aa[row][ column -1 ] = 1 and jump = 0 and fall = 0 and dx = 0
            move = 0
            px = px + 1
            if aa[row +1][ column + 1 ] = 1 then fall = 1

            dbm = 14
       endif
        ' Stop horizontal movement at wall while jumping
       if move = 1 and dir = 1 and aa[row+1][ column + 1] = 1 and aa[row+1][ column] = 0 and jump > 0 and dx = 0
            move = 0
            dbm = 15
       endif
       if move = 1 and dir = 2 and aa[row+1][ column - 1] = 1 and aa[row+1][ column] = 0 and jump > 0 and dx = 1
            move = 0
            dbm = 16
       endif
         ' stop  at wall while moving left
       if move = 1 and dir = 2 and aa[row][ column - 1] = 1  and dx = 1
            px = px + 1
            dbm = 16
       endif              
         ' stop  at wall while moving left and slightly above wall
       if move = 1 and dir = 2 and aa[row + 1][ column - 1] = 1  and dx = 1 and dy > 2
            px = px + 1
            dbm = 16
       endif
        ' Stop  fall at floor
       if move = 1 and dir = 1 and aa[row + 1][ column ] = 1 and fall = 1
            fall = 0
            dbm = 17
       endif
       if move = 1 and dir = 2 and aa[row + 1][ column ] = 1 and fall = 1
            fall = 0
            dbm = 18
       endif
        ' Stop fall at top of wall  

       if move = 1 and dir = 1 and  aa[row + 1 ][ column + 1] = 1 and aa[row ][ column ] = 0 and fall = 1
          fall = 0
          move = 0
          dbm = 19
       endif
       if move = 1 and dir = 1 and  aa[row ][ column + 1] = 1 and aa[row ][ column ] = 0 and fall = 1  
           fall = 0  
           move = 0
           dbm = 20
       endif
       if move = 1 and dir = 1 and  aa[row + 1 ][ column ] = 0 and aa[row + 1 ][ column + 1 ] = 1 and fall = 1  
          fall = 0
          move = 0
          dbm = 21
       endif
       if move = 1 and dir = 1 and aa[row + 1 ][ column + 1 ] = 1 and fall = 1  
          fall = 0
          move = 0
          dbm = 22
       endif
        ' stop fall if hitting left side and top of block
       if move = 1 and dir = 2 and aa[row - 1 ][ column + 1 ] = 1 and fall = 1
          fall = 0
          dbm = 23
       endif
 
       ' stop left movement if hitting wall while moving left  ????????
       if move = 1 and dir = 2 and aa[row ][ column - 1 ] = 1 and fall = 1 and dx = 0
          fall = 0
          move = 0
          dbm = 24
       endif


        ' Stop jump at ceiling

       if  aa[row ][ column ] = 1 and jump > 0  
            jump = 0
            fall = 1
            dbm = 25
       endif
       if   dir = 1 and aa[row ][ column + 1 ] = 1 and jump > 20  
            jump = 0
            fall = 1
            dbm = 26
       endif
           'stop jump if ceiling on right
       if   dir = 2 and aa[row - 1 ][ column + 1 ] = 1 and jump > 0  and dx > 1 and dy = 1  
            jump = 0
            fall = 1

            dbm = 27
       endif
         ' stop fall if floor on right ??????
       if   dir = 2 and aa[row + 1 ][ column + 1 ] = 1 and fall = 1 and dy = 0 and move = 1  
            py = py -1
           
            fall = 0
            dbm = 27
       endif



       if dir = 2 and dy > 0 and aa[row + 1][ column ] = 1
            jump = 1
            move = 0
            dbm = 28
       endif

      if px > 1300
       '  px = 1300   #####################################
         dbm = 29
      endif
      if px < 60
          px = 60
          dbm = 30
      endif
    ' stop jump at top of board
      if py < 51
          fall = 1
          jump = 0
          dbm = 31
      endif
     
    ch = inkey(1)

      ' Go to start
    if ch = 32
        px = 300 ; py = 150 ; move = 0; jump = 0 ; fall = 0 ; xoffset = 0 ; yoffset = 0
    endif

       ' right
    if ch = 39
       
       dir = 1
       move = 1
       
    endif

       ' left
    if ch = 37

         dir = 2
         move = 1
       
    endif
    if move = 1 and dir = 1  then px = px + 1
    if px > 50 and move = 1 and dir = 2 then px = px - 1

    ' stop
    if ch = 40 then
        move = 0
        fall = 0
        jump = 0
    endif

    ' up
    if ch = 38 and jump = 0 and fall = 0  
        jump = 1
        fall = 0
       
    endif

   
     
       if dx < 49 then  draw image 1, zx-xoffset, zy - yoffset ;    ' main screen
      if move = 1 then draw image 6,px+1 - xoffset ,py+1 - yoffset  ; ' image 6 is blank square
      if jump > 0 then draw image 6,px+1 - xoffset ,py+1 - yoffset
      if fall = 1 then draw image 6,px+1 - xoffset ,py+1 - yoffset

      if dir = 1 then draw image 4,px+1 - xoffset ,py - yoffset     ; ' player right
      if dir = 2 then draw image 5,px - xoffset ,py - yoffset       ; ' player left
      if dir = 1 and jump = 1 then draw image 4,px+1 - xoffset ,py - yoffset
      if dir = 2 and jump = 1 then draw image 5,px - xoffset ,py - yoffset
   '   proc print1
   
      redraw
         
    wait 1
   
  wend

endproc


procedure print1()
       ' this procedure used for debugging
       ' sq1 = px/50
        set color 0,0,0
        draw rect 10,520,140,210,1
        set color 255,255,255
        set caret 10,520
        write "px  "; write px ; write " py  " ; wln py
        write "column " ;  write column ; write " row "; wln row
        write "move  " ; wln move
        write "jump  " ; wln jump
        write "fall  " ; wln fall  
        write "dir  " ; wln dir
        write "columnx " ; wln columnx
        write "cx " ; wln cx
        write "rowy ";  wln rowy
        write "ry " ; wln ry
        write "dx " ; wln dx
        write "dy " ; wln dy
        if dbm > 0 then wln dbm
          if dbm2 <> dbm
            set caret cnt1,735
            cnt1 = cnt1 + 60
             write dbm ; write "      " ;
          endif
          if cnt1 > 150
             cnt1 = 60
          endif
          dbm2 = dbm
     ' redraw
     
endproc

procedure images()
     for a = 3 to 10
        create image a, 50, 50
     next
        create image 11, 400,60
     set image 3
     ' square
     set color 0,0,220
     draw rect 0,0,49,49,1
     set color 255,0,0
     draw rect 0,0,49,49
     draw rect 1,1,48,48
        set color 255,255,255
        draw rect 23,23,4,4 ; draw rect 21,21,8,8 ; draw rect 19,19,12,12 ; draw rect 17,17,16,16
        set color 255,255,0
        draw rect 15,15,20,20 ; draw rect 13,13,24,24 ; draw rect 11,11,28,28 ; draw rect 9,9,32,32

     set image 4
     ' pac right
     set color 255,0,255
     draw rect 0,0,50,50,1
     set color 255,255,0
     draw ellipse 25,25,22,22,1
     set color 250,250,255
     draw ellipse 25,25,20,20,0
     draw ellipse 25,25,18,18,0
     draw ellipse 26,16,4,4,0
     set color 255,0,255
     set pixel 25,15 ; set pixel 27,15 ; set pixel 27,17 ; set pixel 25,17 ; set pixel 25,15 ;  
     t1[] = [ 25,25,50,15,50,35 ]
     draw poly t1,1

     set image 5
     ' pac left
     set color 255,0,255
     draw rect 0,0,50,50,1
     set color 255,255,0
     draw ellipse 25,25,22,22,1
     set color 250,250,255
     draw ellipse 25,25,20,20,0
     draw ellipse 25,25,18,18,0
     draw ellipse 26,16,4,4,0
     set color 255,0,255
     set pixel 25,15 ; set pixel 27,15 ; set pixel 27,17 ; set pixel 25,17 ; set pixel 25,15 ;  
     t1[] = [ 25,25,0,15,0,35 ]
     draw poly t1,1

     set image 6
     set color 0,0,0
     draw rect 1,1,49,49,1

        set image 11
        set color 255,255,255
        write "@  " ; write dbm


     set color 255,255,255
     set image primary
     
endproc



end
 The arrow keys move the icon. The up arrow is jump. The down arrow is stop. The space bar starts over and the esc key ends game.
Reply
#2
Glad to see that still working done in NaaLaa, thanks for sharing Rick, i did tried this in Linux but it looks like the keyboard isn't working, i must try on a different machine, anyway thanks for sharing the code :-).
Reply
#3
Umm... The ESC key works like a charm, but the other keys, not so much... No movement left or right or jump...

I'm running the Linux version of N6.

J

ps: imported the keycodes.lib as a work-a-round. Man, this if one large map! Cool...
Reply
#4
Thanks guys

 Someday, I hope to see some Windows users, or maybe I can get a copy of Linix working on something.
Reply
#5
It looks nice! I got stuck on walls a couple of times while jumping, but coding would be no fun without bugs Smile
Reply
#6
(03-11-2020, 05:09 PM)Marcus Wrote: It looks nice! I got stuck on walls a couple of times while jumping, but coding would be no fun without bugs Smile

      I heard somewhere a long time ago, that some bugs were actually " Undocumented features".
Reply
#7
I would like to see platformer in AbuSimbel style  Wink
Reply
#8
(03-17-2020, 08:18 PM)Aurel Wrote: I would like to see platformer in AbuSimbel style  Wink

   Nice idea. I'll keep it in mind.

https://www.youtube.com/watch?v=ZercAs9cqZ8
Reply
#9
Cool. I haven't played a game like that for quite some years...
Reply
#10
Many thanks Rick......controls work fine on my Windows 10 laptop. Nice to see people still using NaaLaa - I spent many hours with it some years ago, and keep thinking that I should revisit it.....this could be a good time as it looks as though I may be stuck indoors for a while here in the UK as we try to work through the Covid 19 currently sweeping through .......
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)