Jump to content
Sign in to follow this  
ZippyRedPlumber

Wraparound Effect

Recommended Posts

The platforming game I'm working uses an effect similar to 2600 Pac-Man. If the player falls off to the bottom he doesn't die, he would appear at the top of the playfield. How can this be achieved?

Share this post


Link to post
Share on other sites

If you want it to be like Pac-Man where he disappears entirely before reappearing on the other side, that should be easy enough. Something like this for p0 and the standard kernel:

 

	if player0y >= player0height + 88 then player0y = 0 ; wrap from bottom to top
	if player0y > 200 then player0y = 87				; wrap from top to bottom

If you want it to appear on the other side pixel by pixel so that part of him is visible on the top and bottom at the same time, it would be more complicated - either you would use both players, or have several player definitions that are the entire height of the screen, and show the player disappearing from one end, and appearing on the other. This would take up a lot of ROM. It would probably be better do to it Pac-Man style.  🙂 

  • Like 2

Share this post


Link to post
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.

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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...