コード例 #1
0
ファイル: ThrowObjectTest.cs プロジェクト: djastin/XNA2DGame
        public void Setup()
        {
            player = new Player();
            player.width = 50;
            player.height = 50;

            thrownObject = new ThrowObject();
            thrownObject.width = 50;
            thrownObject.height = 50;

            level = new Level();
            level.Player = (Player)player;
            level.ThrownObjects = new List<ThrowObject>();
            level.ThrownObjects.Add((ThrowObject)thrownObject);

            throwAttack = new ThrowAttack();
            throwAttack.SetLevel(level);
            thrownObject.SetLevel(level);
            player.SetLevel(level);
            throwingEnemy = new LittleEnemy();
            throwingEnemy.SetAttack(throwAttack);
        }
コード例 #2
0
ファイル: Level.cs プロジェクト: djastin/XNA2DGame
 private void InitializeEnemy(Enemy enemy)
 {
     if (enemy is EndBoss)
     {
         ((EndBoss)enemy).Initialize();
     }
     else
     {
         enemy.Initialize(true);
     }
     enemy.SetLevel(this);
     enemy.SetAttack();
 }