Friday, July 18, 2008

Step 2 - Actors are Actors

In this step we will cover setting up the main Scene. As stated earlier, each room must connect to 3 adjoining rooms. So that's the plan. We will create a room scene with our player actor and later we will add 3 gateway actors to other rooms. And what I mean by gateway is basically an actor that will trigger a scene change when the player actor touches it.

However in this post all we are going to do is to setup the main scene with background, add boundries and our Player actor.

Ok here we go...

  1. Login to Popfly and select "Create a Game".

  1. Be brave and select ... or start from scratch.




  2. Click the scene globe to edit scenes, then the main scene icon.

  3. Add a background. I choose the dungeon background because well the player will be exploring dungeons. Note: the scale image to background button should be highlighted by default, if not click it before adding your background. This way the background image will scale to the size of your background automatically. Then click the close button, circled X.


  4. Since we need a bit more room to move around, change the scene size to Width:1024 and Height:760. That's a good old graphics resolution number, so hopefully it will show up fine on most computers. Hint: If you have a high resolution monitor, maximize your window so the entire scene will fit.

Now that we are done with the basic setup, let's start adding the fun stuff.

  1. First a few actors: the Player and the scene boundaries. The boundries are really walls that we try to hide so they don't clutter the scene. The job of the boundries is to keep the player in the scene. Now click Actors.

  2. For the player actor I chose: Ninja Boy. He's good for a couple of reason, he's cool but I'll really elaborate as to why later. You can choose whom ever you like. But from now on, when I mention the player, I really mean the player actor. Lastly, I renamed Ninja Boy to Player, just so it's a bit easier to use.
  3. As for the scene boundary, I chose "Silver Button". I really was looking for blackish, but couldn't find it, so hope the silver color works out. I renamed "Silver Button" to Boundary.

Now that we have our boundaries we need to make it useful.

  1. Click the Boundary Icon and the make the boundary a solid actor but clicking on the bricks icon. This way, when our Player touches it, we can get it to stop our player.
  2. However, just making solid won't stop our player. GameCreator has a built in physics engine so all actors have mass (for you non-physics peeps, let's just say mass is what makes things heavy). The default mass for all actors is 0. So if our actor is moving and collides with the boundary that has the same mass and not moving, the boundary will move. So much for stopping the actor from leaving the scene. This reaction is due to conservation of momentum, but I won't get into a physics lesson here. Let's just say if the boundary was more massive then it wouldn't move. So let's do that.
  3. To add more mass to the Boundary click the boundary actor icon and the select properties. Set the mass property to 1000. That's really massive compared to 1. So it shouldn't move.

Ok the Boundary actor is all done. Now time to setup the Player.



  1. Click the Player in the actors list, then the Behaviors buttons since we need to add movement controls.
  2. Click motion then event in the motion menu. In choose an event, select Keyboard, then select a key to move left. I chose the left arrow. Click close to end your selection, then click the motion icon in Player Actions.
  3. In the Motion menu select the Left Arrow (west) and make sure it Relative to: is set to scene. This will make our actor move left.
  4. Make sure to click "While receive event." Otherwise our actor will never stop moving. Then click close.
  5. Lastly rename the behavior to: MoveLeft so you can easily know what it's doing.
  6. Repeat steps 1-4 again for moving Up, Down, and Right.

Well that's it. You have your basic parts. In the next lesson, we'll get the actors to do something. Be sure to save your game RIGHT NOW!

No comments: