Unsurreal Posted May 15, 2004 Share Posted May 15, 2004 Hi... I'm having difficulties on moving a sprite which was horizontally located by the RESP0 comand, it just doesn't move. Can somebody help me on this? Quote Link to comment Share on other sites More sharing options...
Bad Panda Bear Posted May 16, 2004 Share Posted May 16, 2004 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. Quote Link to comment Share on other sites More sharing options...
Unsurreal Posted May 16, 2004 Author Share Posted May 16, 2004 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.