bluetriforce Posted November 15, 2005 Share Posted November 15, 2005 Hi, For weeks I am trying to make the ball moving across the screen in a small path across the screen? I am almost new to batari basic. This is my source code dim dirx = a COLUPF = 204 : score = 0 ballx = 20 : bally = 20 dirx = 1 bally = 20 : ballheight = 1 gameloop scorecolor = 158 drawscreen ballx = ballx + 1 if ballx < 40 then dirx = dirx + 1 goto gameloop Thanks Quote Link to comment Share on other sites More sharing options...
+batari Posted November 15, 2005 Share Posted November 15, 2005 (edited) Hi, For weeks I am trying to make the ball moving across the screen in a small path across the screen? I am almost new to batari basic. This is my source code 965737[/snapback] I assume you want dirx to be the ball's direction. To bounce the ball back and forth between ballx=20 and ballx=40, for instance, you can change your program to this: dim dirx = a COLUPF = 204 : score = 0 ballx = 20 : bally = 20 dirx = 1 bally = 20 : ballheight = 1 gameloop scorecolor = 158 drawscreen ballx = ballx + dirx if ballx < 20 || ballx > 40 then dirx = 0 - dirx goto gameloop Edited November 15, 2005 by batari Quote Link to comment 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.