Exemplo n.º 1
0
        // CONSTRUCTORS
        public MenuHome()
        {
            this.head1 = new EntityAnimatedSprite(new AnimatedSprite("playerHead", 1, 1, 10, 1f, 1f));
            this.head1.ESprite.Origin = new Vector2(this.head1.ESprite.Width / 20, this.head1.ESprite.Height / 20);
            this.head1.ESprite.X      = 0;
            this.head1.ESprite.Y      = Misc.WindowHeight;

            this.head2 = new EntityAnimatedSprite(new AnimatedSprite("playerHead", 1, 1, 10, 1f, 1f));
            this.head2.ESprite.Origin = new Vector2(this.head2.ESprite.Width / 20, this.head2.ESprite.Height / 20);
            this.head2.ESprite.X      = Misc.WindowWidth;
            this.head2.ESprite.Y      = Misc.WindowHeight;

            this.background      = new EntitySprite(new Sprite("home_background", 4, false));
            this.title           = new EntitySprite(new Sprite("title", 2, true));
            this.title.ESprite.X = Misc.WindowWidth / 2 - this.title.ESprite.Width / 2;
            this.title.ESprite.Y = Misc.WindowHeight / 2 - this.title.ESprite.Height * 2 - this.title.ESprite.Height / 2;

            this.startButton           = new EntityButton("PLAY");
            this.startButton.ESprite.X = Misc.WindowWidth / 2 - this.startButton.ESprite.Width / 2;
            this.startButton.ESprite.Y = Misc.WindowHeight / 2 - this.startButton.ESprite.Height / 2;

            this.quitButton           = new EntityButton("QUIT");
            this.quitButton.ESprite.X = Misc.WindowWidth / 2 - this.quitButton.ESprite.Width / 2;
            this.quitButton.ESprite.Y = Misc.WindowHeight / 2 + this.quitButton.ESprite.Width / 2;

            this.madeFor           = new Text("Made by MatKubik for Ludum Dare 39", "ButtonFont", Misc.WindowWidth / 2, Misc.WindowHeight - 25);
            this.madeFor.TextColor = Color.Orange;
        }
        // CONSTRUCTORS
        public EntityPlayerPowerBar(int playerBasePower)
            : base(new Sprite("playerPB", 4, false))
        {
            this.ESprite.X = Misc.WindowWidth / 2 - this.ESprite.Width / 2;
            this.ESprite.Y = 20;

            this.movingBar           = new EntityAnimatedSprite(new AnimatedSprite("playerPBM", 1, 1, 4, 1, 1));
            this.movingBar.ESprite.X = Misc.WindowWidth / 2 - this.ESprite.Width / 2 + 4;
            this.movingBar.ESprite.Y = 24;
            this.oldWidth            = this.movingBar.ESprite.Width;

            this.playerBasePower     = playerBasePower;
            this.yourPower           = new Text("POWER BAR", "ButtonFont", Misc.WindowWidth / 2, this.movingBar.ESprite.Y + this.movingBar.ESprite.Height * 4);
            this.yourPower.TextColor = Color.SkyBlue;
        }
Exemplo n.º 3
0
        // CONSTRUCTORS
        public MenuGame()
        {
            Misc.blueBarrelGet     = 0;
            Misc.redBarrelGet      = 0;
            Misc.grayBarrelGet     = 0;
            Misc.questionBarrelGet = 0;
            Misc.playTimer         = "";

            this.speedPlusTimer = 0f;

            this.timerPanel = new EntityAnimatedSprite(new AnimatedSprite("uiPanel", 1, 1, 6, 1f, 1f));
            this.timerPanel.ESprite.Effect = SpriteEffects.FlipHorizontally;
            this.timerPanel.ESprite.X      = Misc.WindowWidth - this.timerPanel.ESprite.Width;

            this.playTimer = new Timer(this.timerPanel.ESprite.X + this.timerPanel.ESprite.Width / 2, this.timerPanel.ESprite.Y + this.timerPanel.ESprite.Height / 2);

            this.barrels = new List <EntityBarrel>();

            this.randPlatSpawnTime = 0;
            this.timer             = 0f;
            this.rand = new Random();

            this.groundSpeed = 6;
            this.background  = new EntitySprite(new Sprite("background", 4, false));

            this.ground           = new EntitySprite(new Sprite("ground", 4, false));
            this.ground.ESprite.Y = Misc.WindowHeight - this.ground.ESprite.Height;

            this.ground1           = new EntitySprite(new Sprite("ground", 4, false));
            this.ground1.ESprite.Y = Misc.WindowHeight - this.ground1.ESprite.Height;
            this.ground1.ESprite.X = Misc.WindowWidth;

            this.player              = new EntityPlayer(this.ground.ESprite.Y);
            this.player.ESprite.Y    = this.ground.ESprite.Y - this.player.ESprite.Height;
            this.randPlatSpawnTime   = rand.Next(2000, 5000);
            this.playerFloorCollsPos = this.ground.ESprite.Y;
        }