Esempio n. 1
0
 public Shot(Player p, string dir = "none")
     : base(p.getX(), p.getY() - 10, 32, 32)
 {
     this.imageFile = "bubble.png";
     this.dir = dir;
     speed = 10;
     x_vel = Convert.ToInt32(p.x_vel * .5 + speed * (p.left ? -1 : 1));
 }
Esempio n. 2
0
 //(p.spriteX - 8, p.spriteY - 8, 48, 48)
 public PowerShot(Player p, string dir = "none")
     : base(p, dir)
 {
     spriteX = p.spriteX + 8;
     spriteY = p.spriteY + 8;
     spriteWidth = 48;
     spriteHeight = 48;
     damage = 3;
 }
Esempio n. 3
0
 /// <summary>
 /// Allows the game to perform any initialization it needs to before starting to run.
 /// This is where it can query for any required services and load any non-graphic
 /// related content.  Calling base.Initialize will enumerate through any components
 /// and initialize them as well.
 /// </summary>
 protected override void Initialize()
 {
     // TODO: Add your initialization logic here
     //Initialize all your objects here
     player1 = new Player(400, -32, 50, 50);
     physics = new Physics();
     controls = new Controls();
     base.Initialize();
 }
Esempio n. 4
0
 //(p.spriteX - 8, p.spriteY - 8, 48, 48)
 public PowerShot(Player p, string dir = "none")
     : base(p, dir)
 {
     imageFile = "charged.png";
     image = p.images["charged"];
     collisionWidth = 18;
     collisionHeight = 18;
     damage = 3;
 }
Esempio n. 5
0
 public Level(Player p)
 {
     player = p;
     enemies = new List<Enemy>();
     projectiles = new List<Sprite>();
     items = new List<Sprite>();
     message = "";
     message_point = 0;
 }
Esempio n. 6
0
        public void Action(Player player, Level level)
        {
            player.powerup[name] = true;

            level.message_point = level.count;
            if (name == "jetpack")
                level.message = "Press and hold the jump button to jetpack!";
            else if (name == "charged")
                level.message = "Press and hold the right trigger to charge a super shot!";
        }
Esempio n. 7
0
        public Shot(Player p, string dir = "none")
            : base(p.spriteX - 16, p.spriteY - 16, 24, 24)
        {
            this.imageFile = "bubble.png";

            this.dir = dir;
            collisionWidth = 8;
            collisionHeight = 8;
            speed = 6;
            damage = 1;
            x_vel = Convert.ToInt32(p.x_vel * .5 + speed * (p.faceLeft ? -1 : 1));
        }
Esempio n. 8
0
 public void Action(Player player, Level level)
 {
     player.powerup[name] = true;
     player.worldPowerUp = name;
     level.message_point = level.count;
     if (name == "jetpack")
         level.message = "Press and hold the jump button to jetpack!";
     else if (name == "charged")
         level.message = "Press and hold the right trigger to charge a super shot!";
     else if (name == "puddle")
         level.message = "Press and hold down to turn into a puddle and avoid damage!";
 }
Esempio n. 9
0
 public Level(Level l)
 {
     player = l.player;
     enterPowerUps = new Dictionary<string,bool>(l.enterPowerUps);
     enterLives = l.player.lives;
     enemies = new List<Enemy>(l.enemies);
     projectiles = new List<Sprite>(l.projectiles);
     items = new List<Sprite>(l.items);
     message = l.message;
     message_point = l.message_point;
     name = l.name;
     content = l.content;
 }
Esempio n. 10
0
 public Level(Player p, string levelName, ContentManager c)
 {
     player = p;
     enterPowerUps = new Dictionary<string, bool>(p.powerup);
     enterLives = p.lives;
     enemies = new List<Enemy>();
     projectiles = new List<Sprite>();
     items = new List<Sprite>();
     message = null;
     message_point = 0;
     name = levelName;
     content = c;
 }
Esempio n. 11
0
        public Shot(Player p, string dir = "none")
            : base(p.spriteX - 16, p.spriteY - 16, 32, 32)
        {
            imageFile = "bubble.png";
            image = p.images["bubble"];

            this.dir = dir;
            collisionWidth = 12;
            collisionHeight = 12;
            speed = 6;
            damage = 1;
            xVel = Convert.ToInt32(p.xVel * .5 + speed * (p.faceLeft ? -1 : 1));
        }
Esempio n. 12
0
 public void Action(Player player)
 {
     player.checkpointXPos = spriteX;
     player.checkpointYPos = spriteY;
 }
Esempio n. 13
0
        protected override void Initialize()
        {
            string initialLevel = String.Format("Content/Level{0}.tmx", 1);
            map = new TmxMap(initialLevel);

            // Read Level Size From Map
            graphics.PreferredBackBufferWidth = map.Width * map.TileWidth;
            graphics.PreferredBackBufferHeight = map.Height * map.TileHeight;

            paused = false;
            // Create built-in objects
            player1 = new Player(
                Convert.ToInt32(map.Properties["startX"]),
                Convert.ToInt32(map.Properties["startY"]),
                32,
                32
            );
            level = new Level(player1);
            controls = new Controls();
            newMapLoad = true;
            newMapTimer = LOAD_SCREEN_TIME;
            player1.newMap = initialLevel;

            song = Content.Load<SoundEffect>("Sounds/InGame.wav");
            instance = song.CreateInstance();
            instance.IsLooped = true;
            if (instance.State == SoundState.Stopped)
                instance.Play();

            base.Initialize();
        }
Esempio n. 14
0
        protected override void Initialize()
        {
            string initialLevel = "Menu";
            map = new TmxMap(String.Format(LEVEL_PATH, initialLevel));

            // Read Level Size From Map
            graphics.PreferredBackBufferWidth = map.Width * map.TileWidth;
            graphics.PreferredBackBufferHeight = map.Height * map.TileHeight;

            paused = false;
            intro = false;
            introImage = Content.Load<Texture2D>("Slides/Slide1.png");
            slideCount = 1;
            previousMap = "";

            // Create built-in objects
            player1 = new Player(
                Convert.ToInt32(map.Properties["startX"]),
                Convert.ToInt32(map.Properties["startY"])
            );
            level = new Level(player1, "menu", this.Content);
            levelSelect = null;
            controls = new Controls();
            pauseControls = new Controls();
            loadingMap = true;
            newMapTimer = LOAD_SCREEN_TIME;
            introScreenTimer = INTRO_SCREEN_TIME;
            player1.newMap = initialLevel;

            song = Content.Load<SoundEffect>("Sounds/InGame.wav");
            instance = song.CreateInstance();
            instance.IsLooped = true;

            bossSong = Content.Load<SoundEffect>("Sounds/Boss.wav");
            bossInstance = bossSong.CreateInstance();
            bossInstance.IsLooped = true;

            menuSong = Content.Load<SoundEffect>("Sounds/Menu.wav");
            menuInstance = menuSong.CreateInstance();
            menuInstance.IsLooped = true;
            menuInstance.Play();

            pauseScreens = new List<Texture2D>();
            for (int i=0; i < 4; i++)
            {
                pauseScreens.Add(Content.Load<Texture2D>(String.Format("Slides/pause{0}.png", i)));
            }
            base.Initialize();
        }