In every moment only one boolean can be true. When Ryu is in static position, the boolean ryuStatic is true and all other are false. To avoid duplications of animations each on of them is grouped with it's own boolean. Here there are the durations of the animations, the boundaries of the level which cannot be passed, the relationship between Ryu and the traps and objects on the map and the monitoring of his HP and MP. This method listens to input from the keyboard and does the corresponding animation. RyuPhysics() takes care of moving, Ryu, switching between basic animations, hits, special abilities, his health and energy. Other the visual Ryu also uses a variety of sound effects, taken from different sources from the web.įor the realization of Ryu there are also a variety of variables and methods, which are created for his needs. ryuWin1 and ryuWin2 - These are two different animations which work in combination and are used when finishing the game.ryuHurt - This is the animation of Ryu when he gets hurt.ryuHadouken is used in combination with ryuHadoukenBall, which is the animation of the fired ball of energy. These animations represent the three special abilities that Ryu posses. ryuHadoukenryuShoryuken and ryuTatsaku.ryuRight - This is Ryu hitting with fist.ryuRight - Used when walking forward/right, up and down.It represents the action of Ryu when tying his headband. ryuReady - This animation is used when starting and finishing the game.Other than inside the game, this sprite is also used in the main menu. It's used each time Ryu isn't moving or doing some action. ryuStatic - This is the static animation.After this duration has passed the framed is followed by the next in the spritesheet. The animation is declared with the spritesheet as source file followed by х which stands for the duration of each frame measured in milliseconds. If the distance isn't measured correctly, there will be inadequacies when drawing the animation. x is formed when we take the horizontal size of the spritesheet and we divide it by the count of frames inside it. The frames of the sprite have to be in an exact distance between each other. png format and with transparent background. When declaring the spritesheet we give the path to the image, x and y, which correspond to the vertical and horizontal size of the sprite frame. Each animation is made of spritesheets.Ī sprite sheet is an image in which there are a couple of sub-images or frames of the animation called sprites. To animate the main character in the game I've used a total of 14 different animations. His coordinates remain the same but we get the effect of moving the character. This way when moving Ryu we actually move the image below him. They are used to move the image in the window ot the program. When creating the map we also create two variables – shiftX and shiftY. This means, that the resulting file is 10MB in size or nearly 3 larger than the equivalent in. png format because of a limitation in Slick2D. The process of building the map is fairly simple, the image must be in. The sprite is downloaded from a website for publication of user-made artwork.Īfter finding the correct sprite, using Photoshop, the tree is duplicated multiple times so the effect of a forest can be made. The forest is made of only one sprite, that of a tree. This forest is an obstruction, which haves the purpose to not allow the main character to go outside the boundaries of the map. Other than the grass there is also a forest from the top and bottom. First the image is scaled to an exact size so the level can be long enough. The map is one huge image, with greenish background imitating grass. Beside at the beginning of the game, the boolean is used in other places, like when the pause menu is open. The boolean enableInput is used to give or inhibit control over the main character. Beside the animation, this method is also responsible for changing the enemies health according to the difficulty, set in the options menu. When reaching scale of 100 a sound starts to play, and when reaching scale of 600 the animation ends. round1Bool takes care of the completion of the animation.
0 Comments
Leave a Reply. |