Hello,
First at all, thanks to this forum to being there =)
I’m not new at all in Java Programming but totally new in Java Game Dev.
I just try to create a simple game with a Yoshi & a world with the libgdx lib (jogl)
But I’ve a problem.
So I’ve some sprites in a texture file to make an animation.
For ex, I use 6464 sprites in two 51264 textures for the walk animation. In each 64*64, I’ve a sprite with Yoshi in a certain position. Each time the game advance, we choose the next sprite… (as described into the libgdx game). I’ve a texture to Walk from left to right and a texture to Walk from right to left. Why ? Because I didn’t centered the sprites but aligned them at the bot-right position. So I can’t flip them. I think it’s not a good solution… but it works.
But my problem is that I want the Yoshi to “stuck out his tongue” (I call this “Slurp”) to right & to left. For the left slurp, it’s ok because the sprite is aligned at the bot-right corner. But to the right… It cause the Yoshi to go back.
I thought about putting the Yoshi in the middle of the sprite but Yoshi+tongue take more than 32pix… That I can’t get him in the middle to be able to use symmetry or…
I don’t know if I can be understood… Sorry ^^
And I don’t really want to expand all my sprites to 128*128 ? Its a bit dirty no? Please throw a light on that ^^
PS: I wanted to put an offset on the drawing method but Jogl have strange axis/scale… Failed to find how to put a PixelOffset.
=> imageshack.us/photo/my-images/577/yoshislurpleft.png
=> imageshack.us/photo/my-images/834/yoshislurpright.png
Here is my class if you want to but I think you won’t need it… And it’s a bit unclean cause it’s tests : pastebin.com/dHwhGha6
Thanks !