Jump to content
IGNORED

Movement


Recommended Posts

How are you trying to move it?

 

If you are trying to move it by setting the HMPx registery, then it won't move until you do a "STA HMOVE". (Note this should be done after an "STA WSYNC")

 

If you are using a full horizontal positioning scheme like described here, then it's simply a matter of changing the horizontal position variable between frames.

 

Hope this helps.

Link to comment
Share on other sites

Well, thanks anyway, but I discovered some other way to make it happen.

The problem was that at every frame I was saying to put the sprite in the same place by setting the RESP0, so it seemed that the moving routine was the problem.

I created a variable to make sure that I would locate the sprite in the place I want it to start just one time. I set it with 1 before the MainLoop (frame loop).

And then this is what I made, after the scanline loop:

 

; Check if I need to locate the Sprite at the center of the screen

 

ldy #82 ;this is the number of cycles I had to "waste"

 

lda rhpos ;load the variable responsable for the checking

beq hpos ;if it's 0 skip the code below and go to hpos

 

lda #0 ;A=0

sta rhpos ;rhpos=0, so it will never happen again

 

timeforhpos ;delay for right positioning

dey

bne timeforhpos

 

sta RESP0 ;and call the sprite right here

 

hpos ;label that the code goes when rhpos is 0

 

Thanks again.

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