Wednesday, April 20, 2011
Demo of a simple 2D game in Java
Now that we move a Sprite, the ideal would encourage using multiple images one after another. To do this we must improve the Sprite class. The new upgrade features a couple of methods; resizeArray, setFrame and GetFrame. Is basically identical to the first one did, only this time working with an array that stores the names of image files that conform the animation. The operation differs slightly, if before the image we were assigned setSprite, now we can only assign a single image, because if we repeat the process with setSprite, we managed to store the next image and so on until we run out of memory . The variable responsible for displaying the image we want is the frame, which will be managed with the methods and setFrame GetFrame
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment