Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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;
            }
        }
Ejemplo n.º 5
0
 public static void Remove(Sprite sprite)
 {
     sprites.Remove(sprite);
 }
Ejemplo n.º 6
0
 public static void Add(Sprite sprite)
 {
     sprites.Add(sprite);
 }
Ejemplo n.º 7
0
 public void LoadContent()
 {
     title = new Sprite(AssetManager.Textures["title"]);
     success = AssetManager.Sounds["pause"].CreateInstance();
     music = AssetManager.Sounds["titlemusic"].CreateInstance();
     music.Play();
 }
Ejemplo n.º 8
0
 public Explosion(ExplosionPart part)
 {
     Sprite = new Sprite(AssetManager.Textures["explosion"], 64, 64, (int)part, 6);
     Sprite.Loop = false;
     ZIndex = 3;
 }