Opry99er Posted March 9, 2011 Share Posted March 9, 2011 I'm trying to write a correlation formula between the dot row/dot column and a standard "HCHAR" or "DISPLAY AT" commands. What I want to do is figure out a way to move my SPRITEs one screen position at a time... Here's the test code I'm workin with right now... "ASP" is the variable for the dot row/column. 10 A=4 :: ASP=A*6+1 100 CALL CLEAR 105 CALL HCHAR(A,A,42) 110 CALL SPRITE(#1,42,2,ASP,ASP) 120 GOTO 120 As you can see, the SPRITE and the actual character are sitting right on top of each other... which is great. But change the "A" variable, and it no longer works. So, this is not a direct correlation. My initial thought was to use: ASP=A*8 But this doesn't work properly. So, basically I'm asking if anyone has a good formula for this... I want the SPRITE to move directly along the standard 24x32 screen positions without overlapping--- I will be moving it 8 pixels at a time, so it will not look "smooth". I hope this makes sense. I feel ridiculous for not being able to figure this out... Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted March 9, 2011 Share Posted March 9, 2011 (edited) ASP=(A-1)*8+1 Works for me every time. Tested with a FOR...NEXT loop using A as my counter EDIT: Proof. 10 FOR A=1 TO 24 :: ASP=(A-1)*8+1 100 CALL CLEAR 105 CALL HCHAR(A,A,42) 110 CALL SPRITE(#1,42,2,ASP,ASP) 120 FOR I=1 TO 100 :: NEXT I :: NEXT A Edited March 9, 2011 by OLD CS1 Quote Link to comment Share on other sites More sharing options...
Opry99er Posted March 9, 2011 Author Share Posted March 9, 2011 Thanks man. =) just what I needed. I should have some cool stuff to show in the next couple days. =) Jigsaw puzzle is really coming together--- this is one piece... just have to reverse it and put the whole formula into place... My exploration routine is about to speed up about 200%. =) 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.