In this post we will learn how to add an object. We will be adding a PAC Man object with some reactions to a Wall object.
To add an object, hover over the tool bar and click on a Blue ball like button that should say add object. You can also add an object by pressing Ctrl + Alt + O.
Name the object descriptive yet again. We chose objPacm for PAC, and objWall for the wall object.
Next it's time to modify the events for the PAC Man object.
Double click on the object for PAC Man and modify the sprite by clicking on the picture next to the sprite box. Add the sprite Pacmstand (the sprite for PAC not moving.).
Next is to add some events for PAC to move in different directions.
With the PAC Man object still open, click Add Event. Add an event for pressing the UP key.
With the up key event opened in the object dialog, add two actions. In the move group (action groups are found on the far right toolbar of the opened sub window), select "start moving in a direction". Tell it to move up at a rate of eight. Then add another action. Change the action group to group "Main 1". In the sprite section of Main 1, there is a button that will change the sprite. Tell it to change to the sprite you made for PAC moving upwards.
Now for the complicated part. Using the same steps add events for pressing the keys for left, right, and down with the same set of actions, moving in a direction at a rate of 8, and changing the sprite to the sprite for PAC moving in that direction.
Once that is done, create a room with the name Roomtest. In that room add the object for PAC with the object dialog.
To add the object to the Room, tell it to make the object added with the left mouse button to be the PAC object. Once that is done tell it to save the room and press teh green arrow on the tool bar to test your objects movements and actions. Once that's done, guess what? You have learnt how to add a sprite, object, room, object in a room, and some basics of this engine. Next time, adding collisions for objects.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment