コード例 #1
0
ファイル: Boulder.cs プロジェクト: bluemagic123/Slip
 public static void Throw(Room room, int x, int y, Vector2 velocity)
 {
     if (((Boulder)room.tiles[x, y].puzzle).bottom)
     {
         y--;
     }
     if (((Boulder)room.tiles[x, y].puzzle).right)
     {
         x--;
     }
     room.RemovePuzzle(x, y);
     room.RemovePuzzle(x + 1, y);
     room.RemovePuzzle(x, y + 1);
     room.RemovePuzzle(x + 1, y + 1);
     room.bullets.Add(new ThrownBoulder(Room.TileToWorldPos(x + 1, y + 1), velocity));
 }
コード例 #2
0
ファイル: SilverKey.cs プロジェクト: bluemagic123/Slip
 public override void OnPlayerCollide(Room room, int x, int y, Player player)
 {
     Vector2 pos = Tile.tileSize * new Vector2(x + 0.5f, y + 0.5f);
     if (Math.Abs(player.position.X - pos.X) <= (Player.size + width) / 2f &&
         Math.Abs(player.position.Y - pos.Y) <= (Player.size + height) / 2f)
     {
         player.silverKeys++;
         room.RemovePuzzle(x, y);
     }
 }
コード例 #3
0
ファイル: FireDungeon.cs プロジェクト: bluemagic123/Slip
 private void Win(Enemy enemy, Room room, Player player)
 {
     room.bullets.Clear();
     for (int x = 0; x < room.width; x++)
     {
         for (int y = 0; y < room.height; y++)
         {
             room.RemovePuzzle(x, y);
         }
     }
     player.exp++;
     room.AddPuzzle(room.width / 2, room.height / 2, new Goal("Fire Dungeon", Color.Brown));
 }