Jump to content
IGNORED

Going to the other side


RHillFake

Recommended Posts

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 :)

Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 1 month later...

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!

Link to comment
Share on other sites

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

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...