public override void ReceiveMessage(WindowMessage message) { switch (message.Type) { case WindowMessageType.StartCombat: this.monster = spawnMonster("death_wind", -20, 0); this.root.AddChild(this.monster); break; case WindowMessageType.CombatCardTouched: int no = (int)message.Data; this.playNextAnimation(no); break; } }
Monster spawnMonster(string name, float x, float y) { Monster battler = new Monster(name); battler.Sprite.LocalPriority = 0.45f; battler.LocalPixelPosition = new Vector2(x, y); //this.battlers.Add(battler); return battler; }