Game Development Community

Creating a Player...

by Ian Willbond · in TGB Platformer Kit · 03/20/2012 (7:22 am) · 1 replies

So I've got to the "Creating a Player" section in the TGB Platformer Kit Tutorial.

Quote:Creating a Player

Actor definitions must be predefined in a "t2dSceneObjectDatablock" object. The one we will be using is named "DragonActorTemplate" stored in the "datablocks.cs" file in your game directory. I've added this datablock to the managed set so it can be accessed through TGB's level editor, which means we can use it in a spawn point.

Create a sprite that represents the type of actor you will be spawning. In this case I used DragonIdleAnimation.
Add the "Spawn Point" behaviour to the sprite.
Change the "TargetType" field to "pskActor".
Change the "TargetObject" field to "DragonActorTemplate".
Change the "MinSpawnDistance" to 0.
Uncheck "AutoDespawn".

That's it. Spawn points are a really easy way of creating and managing objects on the fly. Now that we have an actor to control, lets test out the level we've made.

Note: If you find that there is a platform you fall through, just make sure that you have added the "Platform Behavior" to the object!

The issue I'm having is the player simply does nothing when I test the scene. The idle animation is running but the player doesn't move or anything. Do I have to add another behavior to this?

Thanks.

#1
03/20/2012 (10:29 am)
Nevermind I just noticed the kit doesn't come with a player.cs