public Enemy(EnemyType type) { Width = 64; Height = 64; ZIndex = 1; switch (type) { case EnemyType.BALLOOM: Sprite = new Sprite(AssetManager.Textures["balloom"], 64, 64, 0, 6); speed = 80; points = 100; wallpass = false; break; } Tile tile; do { tile = LevelManager.CurrentLevel.GetTile(Blackboard.Random.Next(1, 30), Blackboard.Random.Next(1, 12)); } while (tile.Solid); destination = tile; Position = tile.Position; EntityManager.Spawn(this); }
public Bomb(int tileX, int tileY) { TileX = tileX; TileY = tileY; ZIndex = 1; Position = LevelManager.CurrentLevel.GetTile(TileX, TileY).Position; Sprite = new Sprite(AssetManager.Textures["bomb"], 64, 64, 0, 6); }
public Player() { Sprite = new Sprite(AssetManager.Textures[Plint ? "alt" : "player"], 64, 68, 0, 6); Position = new Vector2(64, 192); Width = 64; Height = 64; ZIndex = 2; keys = new List<Keys>(); walkSound = AssetManager.Sounds["walk"].CreateInstance(); EventManager.AddListener(KeyboardEvent.KEY_PRESSED, this); EventManager.AddListener(KeyboardEvent.KEY_RELEASED, this); }
public void SetType(TileType type) { switch (type) { case TileType.GRASS: Solid = false; Sprite = new Sprite(AssetManager.Textures["grass"]); break; case TileType.POST: Solid = true; Sprite = new Sprite(AssetManager.Textures["post"]); break; case TileType.WARP: Solid = false; break; case TileType.WALL: Solid = true; Sprite = new Sprite(AssetManager.Textures["wall"], 64, 64); break; } }
public static void Remove(Sprite sprite) { sprites.Remove(sprite); }
public static void Add(Sprite sprite) { sprites.Add(sprite); }
public void LoadContent() { title = new Sprite(AssetManager.Textures["title"]); success = AssetManager.Sounds["pause"].CreateInstance(); music = AssetManager.Sounds["titlemusic"].CreateInstance(); music.Play(); }
public Explosion(ExplosionPart part) { Sprite = new Sprite(AssetManager.Textures["explosion"], 64, 64, (int)part, 6); Sprite.Loop = false; ZIndex = 3; }