Jump to content

Daniel Manoiu

New Members
  • Posts

    2
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Daniel Manoiu's Achievements

Combat Commando

Combat Commando (1/9)

2

Reputation

  1. @DaveM Thank you! The and #8 worked great for the simple animation I was going for. It did shift some things around with the change of sprite when player collides with enemy, but I think I can figure that out. @SpiceWare thank you, what a great resource! I got into Atari programming from the Udemy course, but I plan to follow all the steps in your tutorial to learn more. @Andrew Davie that seems like a way more efficient and less verbose way of doing this. I’ll give it a try. @bogax yes, the AND/ bne seems to work great, I didn’t really commit to the 10 frame switch, it was pretty arbitrary based on what I thought would look decent. But will definitely try the lo byte trick. I have an enemy sprite (P1) that I’d like to flip between two frames of animation at controlled random speeds, that will be a new challenge!
  2. Hello everyone, I'm new here and very new to Atari programming. I'm having some issues trying to figure out how to have my player character alternate between two frames of animation when moving. So far, this is the code that I came up with: AreWeChanging: lda P0FrameCounter cmp #10 bne ChangeSpriteBack ChangeSprite: lda #0 sta P0FrameCounter lda #<P0Sprite2 sta P0SpritePtr ; lo byte pointer for P0 Sprite lda #>P0Sprite2 sta P0SpritePtr+1 ; hi byte ptr for P0 Sprite jmp End ChangeSpriteBack: lda #<P0Sprite1 sta P0SpritePtr ; lo byte pointer for P0 Sprite lda #>P0Sprite1 sta P0SpritePtr+1 ; hi byte ptr for P0 Sprite End: jmp StartFrame Basically, it's just switching to the second sprite of the animation when the P0FrameCounter variable reaches 10 and then switches back. I am incrementing the variable when moving the joystick in any direction. This is not great for 2 reasons: it only changes to the seconnd sprite for one frame of animation then changes to the first one for 10 frames; and, seems to be a bit buggy if I'm testing it in the emulator and pressing two directional buttons, or moving diagonally. What approach should I use to alternate between the two sprites for an equal amount of time (let's say 10 frames per sprite), only when the directional buttons are pressed? Thanks in advance for your help!
×
×
  • Create New...