Example #1
0
 private void HandleDamage(DrawablePhysicsObject crate)
 {
     if (crate.Position.X > player.Position.X && crate.Position.X < player.Position.X + player.Rectangle.Width && crate.Position.Y <= player.Position.Y)
     {
         hud.DecreaseHealth(50);
     }
 }
Example #2
0
        private void SpawnCrate(float x)
        {
            DrawablePhysicsObject crate;

            crate          = new DrawablePhysicsObject(world, new Vector2(50.0f, 50.0f), false);
            crate.Position = new Vector2(x, 1);
            crate.Load(crateTexture);

            cratesAndBricks.Add(crate);
        }
Example #3
0
        private void SpawnBrick()
        {
            DrawablePhysicsObject brick;

            brick          = new DrawablePhysicsObject(world, new Vector2(19.0f, 14.0f), false);
            brick.Position = new Vector2(random.Next(mapWidth), 1);
            brick.Load(brickTexture);

            cratesAndBricks.Add(brick);
        }
Example #4
0
        private void SpawnCrate(float x)
        {
            DrawablePhysicsObject crate;
            crate = new DrawablePhysicsObject(world, new Vector2(50.0f, 50.0f), false);
            crate.Position = new Vector2(x, 1);
            crate.Load(crateTexture);

            cratesAndBricks.Add(crate);
        }
Example #5
0
        private void SpawnBrick()
        {
            DrawablePhysicsObject brick;
            brick = new DrawablePhysicsObject(world, new Vector2(19.0f, 14.0f), false);
            brick.Position = new Vector2(random.Next(mapWidth), 1);
            brick.Load(brickTexture);

            cratesAndBricks.Add(brick);
        }
Example #6
0
 private void HandleDamage(DrawablePhysicsObject crate)
 {
     if (crate.Position.X > player.Position.X && crate.Position.X < player.Position.X + player.Rectangle.Width && crate.Position.Y <= player.Position.Y)
         hud.DecreaseHealth(50);
 }