So my first assignment for the XNA class is to create a 2D game; Or at least create the begninning of one. I’ve decided to try and make a bomberman clone, like I said in the post before.
Either way, in order to do that were going to need sprite animating. It makes most sense to me to put this in a class somewhere, that way if we have other things other than the players that we want to animate, we’ll be able to just toss it to this class and, boom, were done. However animating a sprite sheet is a little more complicated that you’d first think. After all it’s just once giant image, with smaller images inside separated by an exact number of pixels. So that means were dealing with nothing but pixels and math. Basic math, but math none the less.
If you were to take the entire sheet, and make it into a grid to see how all the images are laid out, you probably wouldnt want to port that straight over to your game. Why? Well, generally sprite sheets have spaces between the character animations. This means if we port straight over, were going to end up with un-even spaces on all the sides of our character, and we dont necessarily want a space that big, or even a space at all.
I’ll write a tutorial on the final class, but i might as well overview it now. Basically we need to create a rectangle, one that is the same size all the time, then we grab different parts of the large sprite using the rectangles X and Y coordinates. Generally animations will remain on the same line, unless its a really long animation then we would need to deal with line breaks. Since we do not want our character to have spaces around it, we need to make sure to calculate exactly how much of the character we want, and what the space is between that so we can add it to our X and Y each time we change the frame.
I know it doesnt make much sense right now, hopefully i will have a tutorial up soon so you can see how its working i just wanted to let you know what i plan on doing next. Keep your eyes open for that!
Maybe you know some resources about animation on PHP? I need more info
I actually do know a lot about PHP, I’ve been doing it for years and years. What type of animation are you trying to do? If it is image animation, you may be able to make something of the GD library, it runs server side and you may be able to create a sort of flip book style image animation if you worked at it.
Other than that, to animate an entire web page, i would probably go with Flash, or something similar.