Question: Using processing please. (Processing.org) Find a spritesheet that contains images about character moving in four different directions. For example, it can look similar to the

Using processing please. (Processing.org)  Using processing please. (Processing.org) Find a spritesheet that contains images about

Find a spritesheet that contains images about character moving in four different directions. For example, it can look similar to the following (of course, you can also use the below example spritesheet if you like) Based on movingDog.zip and spriteSheetAnimation pde write a Processing program to create an animation that can move the animated character with key pressings in the game window. The character images are those read from the spritesheet. Different directions should have different animations. For example, if we use the above shown spritesheet, when you press the left key, you will only see the animation created from the four images in the second row. Similarly, pressing the up key will show a character moving up. Note when you release the key, the animation should stop Hint: in spriteSheetAnimation.pde, we get sprite images using "PImage sprite spritesheet.get(x, y, W, H):", where x is a horizontal stride of the character's width, and y is a vertical stride of the character's height. So, when draw0 is iterated, we can pick up every small character image from the whole spritesheet with a horizontal stride andor a vertical stride (vertical stride only takes place when we finish one row of character images and switch to the next row). In this assignment, if you press an arrow key, say, LEFT, you only pick up every small chacter age from the 2nd row with horizontal strides, i.e. you can use the following iftkeyCodeLEFT && keyPressed true&sprite spritesheet.get(x, H, W, H). ? You can write similar statements for moving in the other three directions. Carefully design the screen layout and add text to your game window. When the character reaches the boundary of the game world, i.e. one of the four walls, he will stop and your game will display the text such as "Slop!". When he leaves the boundary, the text will change to something clse such as "This is the game world When the character reaches the boundary, he will shrink half in both x and y directions (i.e. become 1/4 of its original size). Due to scaling, you may notice that he also changes his position. Try to make the character stay at the same position before and after scaling. It's ok if there may still have a small horizontal difference, because the character images are not tightly packed in the spritesheet (for example, in the above spritesheet, a character sprite keeps a distance to his left and right neighbors). We don't want the character's position to have big difference in vertical before and after scaling

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!