Jump to content
Sign in to follow this  
Captain Spazer

DPC+ Sprite 2 and 3 not moving in unison

Recommended Posts

I'm having a bit of trouble with DPC+, I am making 2 big sprites for player 1 and 2 composed of 2 sprites each.

Sprites 0-1 for player1 and sprites 2-3 for player 2.

 

When I move player2's joystick sprites 2-3 are not in unison, destroying the illusion of 1 sprite by leaving a gap. What can I do?

 

DPC_Big_Sprites.bas

Share this post


Link to post
Share on other sites

The problem here is that you are using one real sprite (player0) to draw one half of one player, and virtual sprites to draw the other half of the player, plus both halves of the second player. Since only 1 virtual sprite is displayed on the same horizontal line at a time, that means for each frame, the left half of the first player is shown, and one of the 3 other player halves is shown, cycling through them every frame. You can see this for yourself if you hit the backtick key (`) in Stella, then hit the Frame +1 button to see how each frame is drawn.

 

Unfortunately, there isn't really a good solution using high-res players like you are trying to do. Probably your best bet would be to use players 0 and 1 for the respective players, and make them double width to eliminate the flicker.

Share this post


Link to post
Share on other sites

I'm currently looking into your issue, I think there might be a way to do it without major flicker.

  • Thanks 1

Share this post


Link to post
Share on other sites

Okay I have a working solution with minimal flicker for both players, I've copied your code into my DPC+ template layout and making some optimizations.

I'll post the new code here once I've got it all fixed up.

Share this post


Link to post
Share on other sites

I might have gone a bit too far with this.

I know you're new to 2600 programming, so I implemented lots of stuff that you could learn from.

Run the precompiled binary in the bin folder to check it out. Runs on the Harmony cart just fine also.

 

You can edit the build.bat and point it to your installation of bB, then just run it to compile the game.

rem ***** MAKE SURE ENVIRONMENT VARS ARE PRESENT *****
set bB=C:\Atari\bB
path=%path%;C:\Atari\bB

 

I split all my DPC+ projects into separate bank files, it makes it easier to work with larger games.

Feel free to use whatever format you're comfortable with, copy and paste the code into your own, or continue on with my updated template style.


Ask away if you have any questions!
[edit] Posted a newer version with player colors and some typo fixes

 

 

Karate_Game_DPC+.7z

Edited by ScumSoft
Update with Colors and typo fixes
  • Like 1
  • Thanks 1

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