|
| Walking Character Game-Editor Tutorial Let's create a walking character. One that will follow the arrow keys on the PC and the 4 way button on the Pocket PC. Start by first downloading one of Reiner "Tiles" Prokein's fantastic freeware sprites. All he asks for is a credit if you use his graphics: http://www.reinerstileset.de Reiner has some great tile artwork also for backgrounds, buildings, paths, all sorts of goodies. OK here we go! 1)Add
Actor and Artwork Add an animation "MainCharN' and add the file "walking n0000.bmp" as a multiple file. Add an animation "MainCharE' and add the file "walking e0000.bmp" as a multiple file. Add an animation "MainCharS' and add the file "walking s0000.bmp" as a multiple file. Add an animation "MainCharW' and add the file "walking w0000.bmp" as a multiple file. Note: You can change the starting animation by using Actor Control and the animation pull-down. Let's start with MainCharN. 2)
Add Key Down/Up Events Add Event Key-down press the up arrow add the event Change Animation, use: Event
Actor Add as immediate action Add Event Key-down press the left arrow add the event Change Animation, use: Event
Actor Add as immediate action Add Event Key-down press the down arrow add the event Change Animation, use: Event
Actor Add as immediate action Add Event Key-down press the right arrow add the event Change Animation, use: Event
Actor Add as immediate action Now test your sprite in Game Mode by making sure he switches directions as you select the different arrow keys.
3)
Add Movement Factors What is this funny looking "x -= 3;" or "x += 3;" you ask??? it's just C language shorthand for saying "x = x - 3" or "x = x + 3" -I started using it and now I am hooked. Here we go! Actor
Control Actor
Control
Actor
Control
4)Stop
Walking Motion When Stationary Our sprite keeps walking even when he is standing still. What we need to do is stop the animation when we release an arrow key, we also need to start the animation back up when we depress an arrow key. We need to use "Change Animation Direction" Forward and Stopped. For each direction add a Key Down and a Key Up event: The
key Down event will be: The
Key Up event will be:
©Copyright TrajectoryLabs.com. All Rights Reserved. | |