About sinFix16()
Posted: Fri Aug 02, 2019 3:42 am
Just a simple question about sinFix16(value)
I'm working with a sprite with horizontal movement, always to the left, then this sprite will disappear from left side of screen and then appear on the right side... and so. I wanted a sin movement, then made:
y = 84 + sinFix16(x); // 84 is the initial 'y' position of the sprite
sinFix16(x) goes from 64 to -64, so Y = 20 .. 148
Why 64 to -64 ???? I read that sinFix16(value) needs a value from 0 to 1024, I just put 'x' and works... not sure why
I just working with int
If I want to a better sin movement, use fix32 or fix16?
I'm working with a sprite with horizontal movement, always to the left, then this sprite will disappear from left side of screen and then appear on the right side... and so. I wanted a sin movement, then made:
y = 84 + sinFix16(x); // 84 is the initial 'y' position of the sprite
sinFix16(x) goes from 64 to -64, so Y = 20 .. 148
Why 64 to -64 ???? I read that sinFix16(value) needs a value from 0 to 1024, I just put 'x' and works... not sure why
I just working with int
If I want to a better sin movement, use fix32 or fix16?