Jump to content

4 direction player sprites?


Recommended Posts

I know I can use REFP0 to flip my player facing left/right


But what about facing up and down? 


Think of it like the sword in adventure   

sure ---->   and  <----  are easy enough to flip left and right..

But what about making the sword face Up or Down?


I am working, and not in front of my development PC at the moment, so can't test this.. but have a curious theory and figured i would ask, before I have a chance

to experiment later this evening.


Could I create 4 labels, then check the direction of the joystick for player0,  and based on the direction being pressed, gosub to that label to set the current player0 graphic, and f the joystick direction changes, then gosub to the applicable label to set the new graphic to represent the image for the new position of the player?

Perhaps only 3 graphics are needed since the left/right can use the same one, and apply reflection


I assume I can also add an additional check, for no input, and just pick whatever one I choose as default, to make sure there is always a valid graphic.


I am just not sure if bB allows you to re-define p0... honestly never tried,  as so far all my programs used a static player sprite... but am looking to expand that behavior now, as well as add player animations as a next step.

Link to comment
Share on other sites

I made a quick example program using the sprite from Seaweed Assault that has animations for 8 directions.


Here's the .bas file so you can look at the code:



Here's the .bin file to use with your favorite emulator:



It uses SWCHA instead of the usual way since that's easier when dealing with an animated sprite that moves in 8 directions.

  • Like 4
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.

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...