RHillFake Posted September 9, 2014 Share Posted September 9, 2014 How do you make it so when your player goes left all the way, he doesn't come out several times before coming out the other side? If you don't know what I am talking about, I am talking about making a smooth transition from entering the left side of the screen and exiting on the right like in Space War. Thanks! Sorry, I couldn't think of a better way to write it Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted September 9, 2014 Share Posted September 9, 2014 I think R.T. developed a tool to help you determine the boundaries given a particular size of sprite. Pending that you just have to keep guessing which x position/value looks best to stop at and then wrap around. Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted September 9, 2014 Share Posted September 9, 2014 Make sure you limit X values to the range of 0-159. If you're always adding or subtracting by 1 then do this after you adjust the X value: if x = 160 then x = 0 : rem the sprite moved off the right side and is now on the left side if x = 255 then x = 159 : rem the sprite moved off the left side and is now on the right side the 255 works because a -1 is the same as 255. 1 Quote Link to comment Share on other sites More sharing options...
RHillFake Posted September 10, 2014 Author Share Posted September 10, 2014 Make sure you limit X values to the range of 0-159. If you're always adding or subtracting by 1 then do this after you adjust the X value: if x = 160 then x = 0 : rem the sprite moved off the right side and is now on the left side if x = 255 then x = 159 : rem the sprite moved off the left side and is now on the right side the 255 works because a -1 is the same as 255. Thanks! That works perfectly! Quote Link to comment Share on other sites More sharing options...
iesposta Posted September 10, 2014 Share Posted September 10, 2014 If you ever move to the DPC+ Kernel you can set one bit location and sprites will move off the edge one vertical slice at a time. Look up DPC+ masking. One value makes a sprite move off the left smoothly, another value makes the sprite move off the right smoothly. I am sure this could be worked into moving smoothly off one side and smoothly appearing on the other, without the sudden jump from one whole sprite on the left to a whole sprite on the right, It is something neat to remember. Quote Link to comment Share on other sites More sharing options...
RHillFake Posted October 29, 2014 Author Share Posted October 29, 2014 While the thing SpiceWare posted worked, with the game I have it makes it kind of unfair, so is their a way that I can make it were there are borders that you can't see outside the visible playfield. Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted October 29, 2014 Share Posted October 29, 2014 While the thing SpiceWare posted worked, with the game I have it makes it kind of unfair, so is their a way that I can make it were there are borders that you can't see outside the visible playfield. You could play with PF0 to make a border. PF0 = %11111111 or something P.S. You must do the PF0 thing before every drawscreen! Quote Link to comment Share on other sites More sharing options...
RHillFake Posted October 29, 2014 Author Share Posted October 29, 2014 You could play with PF0 to make a border. PF0 = %11111111 or something P.S. You must do the PF0 thing before every drawscreen! All the info I could find on PF0 says that it only does vertical borders. Is there a way to do horizontal? Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted October 29, 2014 Share Posted October 29, 2014 All the info I could find on PF0 says that it only does vertical borders. Is there a way to do horizontal? No dice. You must manually draw playfield pixels. For instance, if you wanted the top to be walled in you could do: var0 = 255 : var1 = 255 : var2 = 255 : var3 = 255 http://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#playfieldvariablechart 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.