spriteTranslate not translating if no initial moveTo

Started by Astrosynthesist, January 05, 2018, 08:03:21 PM

Previous topic - Next topic

Astrosynthesist

Two things:
In the Vectrex32 manual on page 63, the code example for "spriteTranslate" uses the call "spriteTranslation"
a = linesSprite({{DrawTo,50,0}})
call spriteTranslate(a,{10,10})

Since there is no initial moveTo, spriteTranslate only moves the end point of the linesSprite and not the beginning point of it, distorting the vector rather than translating it.

Vectrex32

Quote from: Astrosynthesist on January 05, 2018, 08:03:21 PM
Two things:
In the Vectrex32 manual on page 63, the code example for "spriteTranslate" uses the call "spriteTranslation"

Thanks for catching that.

Quote
a = linesSprite({{DrawTo,50,0}})
call spriteTranslate(a,{10,10})

Since there is no initial moveTo, spriteTranslate only moves the end point of the linesSprite and not the beginning point of it, distorting the vector rather than translating it.

OK, I can see that. What do you think the correct behavior should be? Inserting a MoveTo into the sprite would be really complicated, and I'd be worried about undesirable side effects.

- Bob

Astrosynthesist

I'm not certain.
What about inserting a moveSprite ahead of it in the drawing list if there is no initial moveTo?

Astrosynthesist

What about using appendArrays to append the old array to {{moveTo,x,y}} or have BASIC recognize there is no moveTo,0,0 at the beginning of the array when the sprite is initialized and adding it before creating the sprite in the first place?

Vectrex32

Having an interpreter alter your array or your drawing list, in an attempt to do what it thinks you meant to do, doesn't feel right to me. And what if the user didn't want the sprite to begin with a MoveTo? Offhand, I can't think of a situation where a user wouldn't want that, but it might happen.

I realize that this is something that people will accidentally run into, and it may cause some head-scratching. But I'm probably going to leave it as-is.

- Bob

Astrosynthesist

Okay then, strong recommend a note in the manual then! :)