* TargetX (number) - this stores the X coordinate of the grid square that PacMan is travelling towards. (Feel free to adjust this later if desired.) * MoveDuration (number) - this stores the number of seconds required for PacMan to travel the width of 1 grid tile. * Direction (number) - this stores the angle of movement that PacMan currently has. Also, add the following instance variables to PacMan: Next, add the Bullet behavior to the PacMan sprite, and set the default value of Speed to 0. Similarly, for the A90, A180, and A270 animations, delete all the frames except the ones where PacMan faces Down, Left, and Up respectively. In the A0 animation, delete all the frames except the two where PacMan is facing to the right (facing an angle of 0 degrees). (This saves you the bother of recreating each animation from the original spritesheet.) Right-click each of the animations and rename them "A0", "A90", "A180", "A270". Do this a total of three times, so that you have 4 animations. Then in the Animations window, right-click on "Default" and choose "Duplication". In the Properties panel, set Speed to 8 and Loop to "Yes". Delete all the frames that do not contain an image of PacMan. The number of horizontal cells is 14 the number of vertical cells is 4. In the Animation frames window, right-click and choose "Import sprite strip.", and choose the image from the beginning of this tutorial containing the PacMan and Ghost images. Create a new Sprite, and rename it PacMan.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |