Jump to content
IGNORED

Snake, issue with tail breaking off


Retro Lord

Recommended Posts

First of all I'd like to thank atari2600land for his work on his tapeworm game. It gave me huge information on how to deal with pfpixels. So I decided I wanted to do a snake game too, but this one will have something no other snake game has on the 2600. An actual head on the snake. I got the game licked I think, my only bug is that after you've grown a bit long your tail breaks off...I can't figure out why. Any ideas?

 

Screenshot of the snakes very cool face:

Namnloumls_zpsdzj0i2ry.png

 

Bin : Anaconda.bin

Source : Anaconda.bas

Link to comment
Share on other sites

Okay, I found a solution to the problem. Now, in this version of "Snake" you eat people. And people move around so you have to chase them and eat them. Now, I have setup level 2 as bit of a maze and I was wondering if there is any elegant solution for preventing player0 from overlapping the walls?

 

The first level is just a big empty square so there I have events that prevents player0 from going outside the screen by seeing if player0 is greater or lesser then certain x and y positions and if greater or lesser player0 is sent back to the last location. Like this:


 if player0x<20 then player0x=20
 if player0x>135 then player0x=135
 if player0y<20 then player0y=20
 if player0y>80 then player0y=80

This is the movement code for the snake and the human. Player1 is the snake, player0 is the human:



 if c>30 && d=1 then u=(rand&3) : e=e+1 : f=f-1 : i=i+1 : h=h+1 : missile1x=missile1x-4
 if c>30 && d=2 then u=(rand&3) : e=e+1 : f=f+1 : i=i+1 : h=h+1 : missile1x=missile1x+4 
 if c>30 && d=3 then u=(rand&3) : e=e+1 : g=g-1 : i=i+1 : h=h+1 : missile1y=missile1y-8
 if c>30 && d=4 then u=(rand&3) : e=e+1 : g=g+1 : i=i+1 : h=h+1 : missile1y=missile1y+8

if c>30 then the snake moves 1 square. and u is selecting a random direction for the human to go too.

 

This is the u values for the human:

 if u=0 then player0x=player0x+8 : u=4
 if u=1 then player0x=player0x-8 : u=4
 if u=2 then player0y=player0y+8 : u=4
 if u=3 then player0y=player0y-8 : u=4

When u=4 then the human stands still.

 

Any tips on how to get a wall detection system for the human?

My own idea would be something like:

 if u=0 && collision(player0,playfield) then player0x=player0x-8 : u=4
 if u=1 && collision(player0,playfield) then player0x=player0x+8 : u=4
 if u=2 && collision(player0,playfield) then player0y=player0y-8 : u=4
 if u=3 && collision(player0,playfield) then player0y=player0y+8 : u=4

Demo: Anaconda.bas.bin

 

Source: Anaconda.bas

Link to comment
Share on other sites

I made a Tapeworm-like game? Wow. I forgot. Anyway, I have some suggestions.

Why not just move the human by one pixel instead of eight? Then you could use a wall-bouncing off of technique or something like this: http://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#find_border_coordinates

Also, I can't start a new game. Is there a way to restart the game after you die? How many lives do you get? A life counter would be nice.

The one-pixel wide gap in the second maze is too narrow for my snake to get into. Try making the gap two or even three pixels wide instead of just one.

Animation on the player running away from the snake would be good.

Also, I found a little bug. You remind me of me back when I was programming a ton of games all at once. Then I learned to just limit yourself to one or two games at once. Then when you've COMPLETED a game, THEN move on to a new project. People will appreciate that better.

 

post-9475-0-14743500-1435600455_thumb.png

Link to comment
Share on other sites

Hm, got it working somewhat now. There are a few times when the human still runs and hides in the walls but most times he bounces of them.

 

Demo : Anaconda.bas.bin

 

Source : Anaconda.bas

 

 

 

Code:

 set kernel_options no_blank_lines

 dim level=p

                                  dim _P0_L_R = player0x.v
                                  dim _P0_U_D = player0y.w

   rem turn on smartbranching
   set smartbranching on

 level=1


  rem a, b, c, d, e, f, g, h, i, k, l, m, n, o, s, t, u
 
begin_level 
 pfclear
 d=0
 e=1 
 a=2 : b=1 
 c=1 : f=2 : g=1
 h=10 : i=1
 u=4
 missile1x=26 : missile1y=15
 k=0 : l=0 : m=0 : n=0 : o=0
 q=0 : z{1}=0
 s=2 : t=11
 


level_designs
 if level=1 then goto level_1
 if level=2 then goto level_2


level_1

 playfield:
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 X..............................X
 X..............................X
 X..............................X
 X..............................X
 X..............................X
 X..............................X
 X..............................X
 X..............................X
 X..............................X
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
end

 player0:
        %00000000
        %00100100
        %00100100
        %00011000
        %01011010
        %00111100
        %00000000
        %00011000
        %00011000
end

 goto get_man_y

level_2
 playfield:
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 X..............................X
 X..............................X
 X..............................X
 XXXXXXXXXX...XXXXXX...XXXXXXXXXX
 XXXXXXXXXX...XXXXXX...XXXXXXXXXX
 XXXXXXXXXX...XXXXXX...XXXXXXXXXX
 X............XXXXXX............X
 X............XXXXXX............X
 X............XXXXXX............X
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
end






get_man_y
 if !z{0} then player0y=rand
 if player0y<15 then goto get_man_y
 if player0y>80 then goto get_man_y 
 
get_man_x
 if !z{0} then player0x=rand
 if player0x<20 then goto get_man_x
 if player0x>135 then goto get_man_x
 z{0}=1 
 

 
main

 if q=10 then level=level+1 : goto begin_level
 rem snakeface down
 if d=4 then player1:
        %00111100
        %01000010
        %10000001
        %10100101
        %11111111
        %11011011
        %10111101
        %11111111
        %01111110
end

 rem snakeface up
 if d=3 then player1:
        %00111100
        %01111110
        %11111111
        %11111111
        %11111111
        %11111111
        %11111111
        %11111111
        %01111110
end

 rem snakface right
 if d=2 then player1:
        %00111100
        %01110010
        %11100000
        %11100001
        %11110111
        %11111101
        %11111011
        %11111111
        %01111110
end

 if d=1 then player1:
        %00111100
        %01001110
        %00000111
        %10000111
        %11101111
        %10111111
        %11011111
        %11111111
        %01111110
end

 scorecolor=$D6
 COLUPF=$D6 : COLUBK=$00 : COLUP1=$22
 if level=1 then COLUP0=64
 if level=2 then COLUP0=64
 
 if joy0left then d=1
 if joy0right then d=2
 if joy0up then d=3
 if joy0down then d=4
 
 if d>0 then c=c+5
  pfpixel f g on
  if !z{0} then goto get_man_y

 drawscreen
 
 if z{1} then r=r+1
 if z{1} && r<20 then AUDV0=6 : AUDC0=12 : AUDF0=10 
 if z{1} && r>20 then r=0 : z{1}=0 : AUDV0=0
 
 if d=1 && i=1 && c>30 then k{0}=1
 if d=2 && i=1 && c>30 then k{1}=1
 if d=3 && i=1 && c>30 then k{2}=1
 if d=4 && i=1 && c>30 then k{3}=1
 
 if d=1 && i=2 && c>30 then k{4}=1
 if d=2 && i=2 && c>30 then k{5}=1
 if d=3 && i=2 && c>30 then k{6}=1
 if d=4 && i=2 && c>30 then k{7}=1
 
 if d=1 && i=3 && c>30 then l{0}=1
 if d=2 && i=3 && c>30 then l{1}=1
 if d=3 && i=3 && c>30 then l{2}=1
 if d=4 && i=3 && c>30 then l{3}=1
 
 if d=1 && i=4 && c>30 then l{4}=1
 if d=2 && i=4 && c>30 then l{5}=1
 if d=3 && i=4 && c>30 then l{6}=1
 if d=4 && i=4 && c>30 then l{7}=1
 
 if d=1 && i=5 && c>30 then m{0}=1
 if d=2 && i=5 && c>30 then m{1}=1
 if d=3 && i=5 && c>30 then m{2}=1
 if d=4 && i=5 && c>30 then m{3}=1
 
 if d=1 && i=6 && c>30 then m{4}=1
 if d=2 && i=6 && c>30 then m{5}=1
 if d=3 && i=6 && c>30 then m{6}=1
 if d=4 && i=6 && c>30 then m{7}=1
 
 if d=1 && i=7 && c>30 then n{0}=1
 if d=2 && i=7 && c>30 then n{1}=1
 if d=3 && i=7 && c>30 then n{2}=1
 if d=4 && i=7 && c>30 then n{3}=1

 if d=1 && i=8 && c>30 then n{4}=1
 if d=2 && i=8 && c>30 then n{5}=1
 if d=3 && i=8 && c>30 then n{6}=1
 if d=4 && i=8 && c>30 then n{7}=1
 
 if d=1 && i=9 && c>30 then o{0}=1
 if d=2 && i=9 && c>30 then o{1}=1
 if d=3 && i=9 && c>30 then o{2}=1
 if d=4 && i=9 && c>30 then o{3}=1
 
 if d=1 && i=10 && c>30 then o{4}=1
 if d=2 && i=10 && c>30 then o{5}=1
 if d=3 && i=10 && c>30 then o{6}=1
 if d=4 && i=10 && c>30 then o{7}=1
 
 if i>s then i=1


 if c>30 && d=1 then e=e+1 : f=f-1 : i=i+1 : h=h+1 : missile1x=missile1x-4
 if c>30 && d=2 then e=e+1 : f=f+1 : i=i+1 : h=h+1 : missile1x=missile1x+4 
 if c>30 && d=3 then e=e+1 : g=g-1 : i=i+1 : h=h+1 : missile1y=missile1y-8
 if c>30 && d=4 then e=e+1 : g=g+1 : i=i+1 : h=h+1 : missile1y=missile1y+8

 j=j+1

 if j=30 then u=(rand&3) : j=0

 if d=2 then player1x=missile1x : player1y=missile1y+1
 if d=3 then player1x=missile1x-3 : player1y=missile1y
 if d=4 then player1x=missile1x-3 : player1y=missile1y+7
 if d=1 then player1x=missile1x-6 : player1y=missile1y+1

 if u=0 then _P0_L_R=_P0_L_R+0.30
 if u=1 then _P0_L_R=_P0_L_R-0.30
 if u=2 then _P0_U_D=_P0_U_D+0.30
 if u=3 then _P0_U_D=_P0_U_D-0.30

 if u=0 && collision(player0,playfield) then u=1
 if u=1 && collision(player0,playfield) then u=0
 if u=2 && collision(player0,playfield) then u=3
 if u=3 && collision(player0,playfield) then u=2


 if player0x<20 then player0x=20
 if player0x>135 then player0x=135
 if player0y<20 then player0y=20
 if player0y>80 then player0y=80

 if c>30 && pfread(f,g) then goto begin_level 
 if c>30 then c=0

 if collision(player1,player0) then u=(rand&3) : score=score+1 : q=q+1 : z{0}=0 : z{1}=1 : s=s+1 : t=t+1

 if c=0 && e>s then pfpixel a b off : e=50 : goto read_pf
 
 if d>0 && c<10 then AUDV1=6 : AUDC1=1 : AUDF1=15 else AUDV1=0
 
 
 goto main

read_pf

 if h>t then h=10 
 if h=10 then goto read_pf_k
 if h=11 then goto read_pf_l
 if h=12 then goto read_pf_m
 if h=13 then goto read_pf_n
 if h=14 then goto read_pf_o
 if h=15 then goto read_pf_p
 if h=16 then goto read_pf_q
 if h=17 then goto read_pf_r
 if h=18 then goto read_pf_s
 if h=19 then goto read_pf_t
 
read_pf_k
 if k{0} then a=a-1 
 if k{1} then a=a+1 
 if k{2} then b=b-1
 if k{3} then b=b+1
 k{0}=0 : k{1}=0 : k{2}=0 : k{3}=0
 goto main
 
read_pf_l 
 if k{4} then a=a-1
 if k{5} then a=a+1 
 if k{6} then b=b-1 
 if k{7} then b=b+1 
 k{4}=0 : k{5}=0 : k{6}=0 : k{7}=0
 goto main
 
read_pf_m 
 if l{0} then a=a-1
 if l{1} then a=a+1 
 if l{2} then b=b-1
 if l{3} then b=b+1
 l{0}=0 : l{1}=0 : l{2}=0 : l{3}=0
 goto main
 
read_pf_n 
 if l{4} then a=a-1 
 if l{5} then a=a+1 
 if l{6} then b=b-1 
 if l{7} then b=b+1 
 l{4}=0 : l{5}=0 : l{6}=0 : l{7}=0
 goto main
 
read_pf_o 
 if m{0} then a=a-1 
 if m{1} then a=a+1 
 if m{2} then b=b-1 
 if m{3} then b=b+1 
 m{0}=0 : m{1}=0 : m{2}=0 : m{3}=0
 goto main 

 
 
read_pf_p 
 if m{4} then a=a-1 
 if m{5} then a=a+1 
 if m{6} then b=b-1
 if m{7} then b=b+1 
 m{4}=0 : m{5}=0 : m{6}=0 : m{7}=0
 goto main
 
read_pf_q  
 if n{0} then a=a-1 
 if n{1} then a=a+1 
 if n{2} then b=b-1 
 if n{3} then b=b+1  
 n{0}=0 : n{1}=0 : n{2}=0 : n{3}=0
 goto main
 
read_pf_r 
 if n{4} then a=a-1 
 if n{5} then a=a+1 
 if n{6} then b=b-1 
 if n{7} then b=b+1 
 n{4}=0 : n{5}=0 : n{6}=0 : n{7}=0
 goto main
 
read_pf_s 
 if o{0} then a=a-1 
 if o{1} then a=a+1
 if o{2} then b=b-1 
 if o{3} then b=b+1 
 o{0}=0 : o{1}=0 : o{2}=0 : o{3}=0
 goto main
 
read_pf_t 
 if o{4} then a=a-1 
 if o{5} then a=a+1 
 if o{6} then b=b-1 
 if o{7} then b=b+1 
 o{4}=0 : o{5}=0 : o{6}=0 : o{7}=0
 goto main

Link to comment
Share on other sites

Hm, I skipped having moving humans, they are instead stationary, but they turn red sometimes and you can't eat them when they are red, they'll kill you. I put in 3 levels but it dosn't really work switching between them when you get 10 points, no idea why...Any pointers?

 set kernel_options no_blank_lines

 dim level=p

                                  dim _P0_L_R = player0x.v
                                  dim _P0_U_D = player0y.w

   rem turn on smartbranching
 set smartbranching on

 c=1 


  rem a, b, c, d, e, f, g, h, i, k, l, m, n, o, s, t, u
begin_level 
 pfclear
 d=0
 e=1 
 a=2 : b=1 
 f=2 : g=1
 h=10 : i=1
 missile1x=26 : missile1y=15
 k=0 : l=0 : m=0 : n=0 : o=0
 q=0 : z{1}=0
 s=2 : t=11
 


level_designs
 if level=1 then goto level_1
 if level=2 then goto level_2
 if level=3 then goto level_3

level_1

 playfield:
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 X..............................X
 X..............................X
 X..............................X
 X..............................X
 X..............................X
 X..............................X
 X..............................X
 X..............................X
 X..............................X
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
end

 player0:
        %00000000
        %00000000
        %00100100
        %00011000
        %00111100
        %00000000
        %00011000
        %00011000
end

 goto get_man_y

level_2

 playfield:
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 X..............................X
 X..............................X
 X..............................X
 X....X....................X....X
 X....XXXXXXXXXXXXXXXXXXXXXX....X
 X....X....................X....X
 X..............................X
 X..............................X
 X..............................X
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
end


level_3
 playfield:
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 X..............................X
 X..............................X
 X..............................X
 X....XXXXXXXXX...X.........X...X
 X....X.......X...X.........X...X
 X....X.......X...XXXXXXXXXXX...X
 X..............................X
 X..............................X
 X..............................X
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
end






get_man_y

 if !z{0} then player0y=rand
 if player0y<15 then goto get_man_y
 if player0y>80 then goto get_man_y 
 
get_man_x
 if !z{0} then player0x=rand
 if player0x<20 then goto get_man_x
 if player0x>135 then goto get_man_x
 z{0}=1 
 

 
main

 if q=10 then level=level+1 : goto begin_level
 rem snakeface down
 if d=4 then player1:
        %00111100
        %01000010
        %10000001
        %10100101
        %11111111
        %11011011
        %10111101
        %11111111
        %01111110
end

 rem snakeface up
 if d=3 then player1:
        %00111100
        %01111110
        %11111111
        %11111111
        %11111111
        %11111111
        %11111111
        %11111111
        %01111110
end

 rem snakface right
 if d=2 then player1:
        %00111100
        %01110010
        %11100000
        %11100001
        %11110111
        %11111101
        %11111011
        %11111111
        %01111110
end

 if d=1 then player1:
        %00111100
        %01001110
        %00000111
        %10000111
        %11101111
        %10111111
        %11011111
        %11111111
        %01111110
end

 scorecolor=$D6
 COLUPF=$D6 : COLUBK=$00 : COLUP1=$22

 
 if joy0left then d=1
 if joy0right then d=2
 if joy0up then d=3
 if joy0down then d=4
 
 if d>0 then c=c+5
  pfpixel f g on
  if !z{0} then goto get_man_y

 drawscreen
 

 
 if d=1 && i=1 && c>30 then k{0}=1
 if d=2 && i=1 && c>30 then k{1}=1
 if d=3 && i=1 && c>30 then k{2}=1
 if d=4 && i=1 && c>30 then k{3}=1
 
 if d=1 && i=2 && c>30 then k{4}=1
 if d=2 && i=2 && c>30 then k{5}=1
 if d=3 && i=2 && c>30 then k{6}=1
 if d=4 && i=2 && c>30 then k{7}=1
 
 if d=1 && i=3 && c>30 then l{0}=1
 if d=2 && i=3 && c>30 then l{1}=1
 if d=3 && i=3 && c>30 then l{2}=1
 if d=4 && i=3 && c>30 then l{3}=1
 
 if d=1 && i=4 && c>30 then l{4}=1
 if d=2 && i=4 && c>30 then l{5}=1
 if d=3 && i=4 && c>30 then l{6}=1
 if d=4 && i=4 && c>30 then l{7}=1
 
 if d=1 && i=5 && c>30 then m{0}=1
 if d=2 && i=5 && c>30 then m{1}=1
 if d=3 && i=5 && c>30 then m{2}=1
 if d=4 && i=5 && c>30 then m{3}=1
 
 if d=1 && i=6 && c>30 then m{4}=1
 if d=2 && i=6 && c>30 then m{5}=1
 if d=3 && i=6 && c>30 then m{6}=1
 if d=4 && i=6 && c>30 then m{7}=1
 
 if d=1 && i=7 && c>30 then n{0}=1
 if d=2 && i=7 && c>30 then n{1}=1
 if d=3 && i=7 && c>30 then n{2}=1
 if d=4 && i=7 && c>30 then n{3}=1

 if d=1 && i=8 && c>30 then n{4}=1
 if d=2 && i=8 && c>30 then n{5}=1
 if d=3 && i=8 && c>30 then n{6}=1
 if d=4 && i=8 && c>30 then n{7}=1
 
 if d=1 && i=9 && c>30 then o{0}=1
 if d=2 && i=9 && c>30 then o{1}=1
 if d=3 && i=9 && c>30 then o{2}=1
 if d=4 && i=9 && c>30 then o{3}=1
 
 if d=1 && i=10 && c>30 then o{4}=1
 if d=2 && i=10 && c>30 then o{5}=1
 if d=3 && i=10 && c>30 then o{6}=1
 if d=4 && i=10 && c>30 then o{7}=1
 
 if i>s then i=1


 if c>30 && d=1 then e=e+1 : f=f-1 : i=i+1 : h=h+1 : missile1x=missile1x-4
 if c>30 && d=2 then e=e+1 : f=f+1 : i=i+1 : h=h+1 : missile1x=missile1x+4 
 if c>30 && d=3 then e=e+1 : g=g-1 : i=i+1 : h=h+1 : missile1y=missile1y-8
 if c>30 && d=4 then e=e+1 : g=g+1 : i=i+1 : h=h+1 : missile1y=missile1y+8

 if d=2 then player1x=missile1x : player1y=missile1y+1
 if d=3 then player1x=missile1x-3 : player1y=missile1y
 if d=4 then player1x=missile1x-3 : player1y=missile1y+7
 if d=1 then player1x=missile1x-6 : player1y=missile1y+1

 j=j+1
 if j=60 then u=(rand&3) : j=0

 if u=0 then COLUP0=$2E
 if u=1 then COLUP0=$2E
 if u=2 then COLUP0=$42
 if u=3 then COLUP0=$2E

 if collision(player0,playfield) then player0x=rand : player0y=rand

 if player0x<20 then player0x=rand : player0y=rand
 if player0x>135 then player0x=rand : player0y=rand
 if player0y<10 then player0x=rand : player0y=rand
 if player0y>80 then player0x=rand : player0y=rand


 if c>30 && pfread(f,g) then goto begin_level 
 if c>30 then c=0

 if collision(player1,player0) && u=0 then  score=score+1 : q=q+1 : z{0}=0 : z{1}=1 : s=s+1 : t=t+1

 if collision(player1,player0) && u=1 then  score=score+1 : q=q+1 : z{0}=0 : z{1}=1 : s=s+1 : t=t+1

 if collision(player1,player0) && u=3  then  score=score+1 : q=q+1 : z{0}=0 : z{1}=1 : s=s+1 : t=t+1

 if collision(player1,player0) && u=2  then reboot


 if c=0 && e>s then pfpixel a b off : e=50 : goto read_pf
 
 if d>0 && c<10 then AUDV1=6 : AUDC1=1 : AUDF1=15 else AUDV1=0
 
 
 goto main

read_pf

 if h>t then h=10 
 if h=10 then goto read_pf_k
 if h=11 then goto read_pf_l
 if h=12 then goto read_pf_m
 if h=13 then goto read_pf_n
 if h=14 then goto read_pf_o
 if h=15 then goto read_pf_p
 if h=16 then goto read_pf_q
 if h=17 then goto read_pf_r
 if h=18 then goto read_pf_s
 if h=19 then goto read_pf_t
 
read_pf_k
 if k{0} then a=a-1 
 if k{1} then a=a+1 
 if k{2} then b=b-1
 if k{3} then b=b+1
 k{0}=0 : k{1}=0 : k{2}=0 : k{3}=0
 goto main
 
read_pf_l 
 if k{4} then a=a-1
 if k{5} then a=a+1 
 if k{6} then b=b-1 
 if k{7} then b=b+1 
 k{4}=0 : k{5}=0 : k{6}=0 : k{7}=0
 goto main
 
read_pf_m 
 if l{0} then a=a-1
 if l{1} then a=a+1 
 if l{2} then b=b-1
 if l{3} then b=b+1
 l{0}=0 : l{1}=0 : l{2}=0 : l{3}=0
 goto main
 
read_pf_n 
 if l{4} then a=a-1 
 if l{5} then a=a+1 
 if l{6} then b=b-1 
 if l{7} then b=b+1 
 l{4}=0 : l{5}=0 : l{6}=0 : l{7}=0
 goto main
 
read_pf_o 
 if m{0} then a=a-1 
 if m{1} then a=a+1 
 if m{2} then b=b-1 
 if m{3} then b=b+1 
 m{0}=0 : m{1}=0 : m{2}=0 : m{3}=0
 goto main 

 
 
read_pf_p 
 if m{4} then a=a-1 
 if m{5} then a=a+1 
 if m{6} then b=b-1
 if m{7} then b=b+1 
 m{4}=0 : m{5}=0 : m{6}=0 : m{7}=0
 goto main
 
read_pf_q  
 if n{0} then a=a-1 
 if n{1} then a=a+1 
 if n{2} then b=b-1 
 if n{3} then b=b+1  
 n{0}=0 : n{1}=0 : n{2}=0 : n{3}=0
 goto main
 
read_pf_r 
 if n{4} then a=a-1 
 if n{5} then a=a+1 
 if n{6} then b=b-1 
 if n{7} then b=b+1 
 n{4}=0 : n{5}=0 : n{6}=0 : n{7}=0
 goto main
 
read_pf_s 
 if o{0} then a=a-1 
 if o{1} then a=a+1
 if o{2} then b=b-1 
 if o{3} then b=b+1 
 o{0}=0 : o{1}=0 : o{2}=0 : o{3}=0
 goto main
 
read_pf_t 
 if o{4} then a=a-1 
 if o{5} then a=a+1 
 if o{6} then b=b-1 
 if o{7} then b=b+1 
 o{4}=0 : o{5}=0 : o{6}=0 : o{7}=0
 goto main

Source: Anaconda.bas

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...