IGNORED

# Dot-Row/Column question

## Recommended Posts

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

##### Share on other sites

`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 by OLD CS1
##### Share on other sites

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%. =)

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

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.