Jump to content
IGNORED

Help me with moving missiles horizontally!


atari2600land

Recommended Posts

So I'm trying to move missile0 horizontally. I can, BUT when it reaches the side of the screen it doesn't do what I tell it to do. It just comes back the other side of the screen. I want player0 to fire the missile again. So I tried this:


Move_missile0_right:

        lda #$E0
        sta HMM0
        
        ; Update x position to account for HMM0 movement
        ldx MissileX+0
        inx            
        inx
        stx MissileX+0
    
        ; check if missile is far enough right yet
        cpx #150
        bcs Get_new_enemy_missile    

        jmp aaaaa

And of course, it won't work. I've attached the whole code here. Any ideas on why it won't work?

 

midspace17a.asm

Link to comment
Share on other sites

Have you checked that the actual horizontal position of the missile is equal to the value in MissileX+0?

And since you are storing the position of the missile anyway, why bother using relative positioning within the program?  Use the PosPlayer subroutine for the missile before you draw the frame instead.

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