4 Replies - 1153 Views - Last Post: 29 December 2011 - 07:48 AM

2D Sprite that does multiple things at once

Posted 29 December 2011 - 03:06 AM

Hi,

I'm learning to make sprite sheets for Xna. However I would like to make a sprite that does several animations at once but that do not always happen at the same time. For example I have quickly made a simple warship sprite in illustrator (attached). What i want to do is create a animation for when it first accelerated for a few seconds where it would quickly rotate upwards and I would draw in a splash animation. But i would also have to be able to rotate the gun turrets almost 180 degrees depending on where the player places the mouse on the screen. I would have to create a huge sprite sheet for every little rotation so it looks smooth. Is this the best way to do this??

Also what if I wanted to accelerate and also rotate the turret. I would have to draw the ship in each stage of the acceleration + every turret possibility so i could achieve this at any stage of the acceleration. I would have to create heaps of different sprite sheets to get all these combos and that seems very complicated. Is there a simpler way to do this??

Also traversing through the sheet to rotate the gun wherever the mouse is would be very hard since its not just one animation going in one direction, the sprite sheet would have to be cycled through forwards and backwards etc. This all seems very complicated again.

I hope this makes sense. Its pretty hard to explain

BTW I'm pretty new to animation concepts so Im not aware of many techniques to do this type of stuff. Whilst Googling I always found stuff about sprite sheets...

Replies To: 2D Sprite that does multiple things at once

Re: 2D Sprite that does multiple things at once

Posted 29 December 2011 - 03:20 AM

You can rotate and flip an entire sprite already using XNA's in built drawing tools, for the gun turrets though you would either need to have them in a separate sprite sheet, or a single turret cannon that is rotated any way you want but mapped on top of the empty gun placement section of the main sprite.

Or if you want to do multiple versions of the ship but with different combinations of gun turret angles from both cannons, it's up to you, but I would go with keeping the turret cannon separate like I mentioned before and just mapping the cannon to the gun placement oval, though this means when the main sprite rotates you want the cannon to rotate firstly to match the angle of the whole ship and then to the correct angle it is supposed to be aimed at.

Re: 2D Sprite that does multiple things at once

Posted 29 December 2011 - 03:32 AM

Ahh i see so I could just create my base ship drawing in illustrator and then just draw in the cannon using XNAs drawing abilitys (since its nothing but a line) and then rotate it using XNA. I guess i could also do the acceleration with XNA rotating tools.

Thanks, Ill have a read of the Xna rotating tools and try getting the basic sprite in my program.

Where I'm confused is why even create sprites in illustrator? We done a little game programming in my java class in uni ages back and we drew and manipulated everything with the drawing tools java provided I can see that its much easier to draw a complex image in illustrator than trying to with the tools and recompiling everytime to check if its really turned out the way i pictured it. But is there any other reason sprites are created in painting programs?