+atari2600land Posted June 30, 2006 Share Posted June 30, 2006 I need some help on a Pong-like game I'm making. This is just a demo so far to make the ball go around like it does on Pong. That means that once it hits the top screen, it goes diagonally down, which I can't seem to make it do. I've tried a bunch of stuff. It's probably something really obvious that I overlooked, but nevertheless, can someone modify this code so that when it hits a side of the screen it bounces diagonally in the opposite direction? 1 set smartbranching on 10 ballheight=4 : CTRLPF=$20 12 COLUPF=14 16 x=40 : y=40 20 ballx=x : bally=y 23 if x=150 then goto 35 25 x=x+1 if x=150 then goto 35 30 goto 40 35 x=x-1 if x=20 then goto 20 37 goto 40 40 y=y-1 if y=20 then goto 50 45 goto 55 50 y=y+1 if y=80 then goto 40 55 drawscreen 60 goto 20 Quote Link to comment https://forums.atariage.com/topic/89942-pong-like-game/ Share on other sites More sharing options...
Recommended Posts
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.