protected override bool _OnRegister(GarageGames.Torque.Core.TorqueObject owner) { base._OnRegister(owner); // set the object type of the owner so other objects will know it's a player owner.SetObjectType(PlatformerData.PlayerObjectType, true); // create a new PlayerController and possess this actor with it PlayerController controller = new PlayerController(); controller.PossessMover(this); //float coolDown = 1000; // Setup attack timers attackActions = new PlayerActions(); attackActions.AddAction("lightAttack", lightAttackCoolDown); attackActions.AddAction("heavyAttack", heavyAttackCoolDown); attackActions.AddAction("baseShot", baseShotCoolDown); attackActions.AddAction("invincibility", invincibilityLength, new OnTimerEndDelegate(ToggleInvincibility)); punchMeleeTemplate = TorqueObjectDatabase.Instance.FindObject<T2DSceneObject>("punch"); swipeMeleeTemplate = TorqueObjectDatabase.Instance.FindObject<T2DSceneObject>("swipe"); // Temp. Add new collision types for the player and enemies //SceneObject.Collision.CollidesWith += PlatformerData.DamageTriggerObjecType; SceneObject.Collision.CollidesWith += ExtPlatformerData.EnemyDamageObjectType; SceneObject.Collision.CollidesWith += PlatformerData.EnemyObjectType; healthbar = new HealthBar_GUI(); healthbar.DisplayedHealth = (int)Health; healthbar.NumCollectedCrystals = 0; GUICanvas.Instance.SetContentControl(healthbar); #if TORQUE_CONSOLE CustomConsoleRoutinePool.Instance.RegisterMethod(HealPlayer); CustomConsoleRoutinePool.Instance.RegisterMethod(WarpToCheckpoint); #endif return true; }