Vectrex32

General Category => Feature Requests and Bug Reports => Topic started by: Astrosynthesist on January 05, 2018, 08:03:21 PM

Title: spriteTranslate not translating if no initial moveTo
Post by: 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"
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.
Title: Re: spriteTranslate not translating if no initial moveTo
Post by: Vectrex32 on January 05, 2018, 08:22:29 PM
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
Title: Re: spriteTranslate not translating if no initial moveTo
Post by: Astrosynthesist on January 05, 2018, 08:43:03 PM
I'm not certain.
What about inserting a moveSprite ahead of it in the drawing list if there is no initial moveTo?
Title: Re: spriteTranslate not translating if no initial moveTo
Post by: Astrosynthesist on January 05, 2018, 08:58:39 PM
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?
Title: Re: spriteTranslate not translating if no initial moveTo
Post by: Vectrex32 on January 05, 2018, 09:26:08 PM
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
Title: Re: spriteTranslate not translating if no initial moveTo
Post by: Astrosynthesist on January 05, 2018, 10:05:57 PM
Okay then, strong recommend a note in the manual then! :)