예제 #1
0
        /*
         * Created By Joshua Ray
         * 11/11/2012
         *
         * Class that represents the Treaures of the game
         *
         */


        /// <summary>
        /// Constructor. Places the enemy at the given Mazeblock. The
        /// mazeblock should be walkable
        /// </summary>
        /// <param name="StartBlock">Starting block</param>
        public Treasure(MazeBlock StartBlock)
        {
            kinetics = Kinetic.ZERO();

            int choice = Utilities.Instance().rand.Next(0, 2);

            switch (choice)
            {
            case 0:
                sprite = TreasureHunter.content.Load <Texture2D>(@"PlanetCute\Gem Blue");
                color  = Color.Blue;
                break;

            case 1:
                sprite = TreasureHunter.content.Load <Texture2D>(@"PlanetCute\Gem Green");
                color  = Color.Green;
                break;

            case 2:
                sprite = TreasureHunter.content.Load <Texture2D>(@"PlanetCute\Gem Orange");
                color  = Color.Orange;
                break;
            }
            kinetics.position = new Vector2(StartBlock.kinetics.boundingBox.Center.X - sprite.Width / 2,
                                            StartBlock.kinetics.boundingBox.Center.Y - sprite.Height / 2);
            Kinetic.SetBoundingBoxDimensions(ref kinetics.boundingBox, sprite);
            kinetics.Update();
        }
예제 #2
0
        /// <summary>
        /// Constructor. Places the enemy at the given Mazeblock. The
        /// mazeblock should be walkable
        /// </summary>
        /// <param name="StartBlock">Starting block</param>
        public Treasure(MazeBlock StartBlock)
        {
            kinetics = Kinetic.ZERO();

            Random rand = new Random(DateTime.Now.Millisecond);

            color = rand.Next(0, 2);
            switch (color)
            {
            case 0:
                sprite = TreasureHunter.content.Load <Texture2D>(@"PlanetCute\Gem Blue");
                break;

            case 1:
                sprite = TreasureHunter.content.Load <Texture2D>(@"PlanetCute\Gem Green");
                break;

            case 2:
                sprite = TreasureHunter.content.Load <Texture2D>(@"PlanetCute\Gem Orange");
                break;
            }
            kinetics.position = new Vector2(StartBlock.kinetics.boundingBox.Center.X - sprite.Width / 2,
                                            StartBlock.kinetics.boundingBox.Center.Y - sprite.Height / 2);
            Kinetic.SetBoundingBoxDimensions(ref kinetics.boundingBox, sprite);
            kinetics.Update();
        }
예제 #3
0
 /// <summary>
 /// Constructor
 /// </summary>
 public MazeBlock()
 {
     sprite   = TreasureHunter.content.Load <Texture2D>(@"PlanetCute\BrownBlock");
     kinetics = Kinetic.ZERO();
     Kinetic.SetBoundingBoxDimensions(ref kinetics.boundingBox, sprite);
     kinetics.boundingBox.Height -= 40;
     color = Color.Violet;
 }
예제 #4
0
 /// <summary>
 /// Constructor. Places the enemy at the given Mazeblock. The
 /// mazeblock should be walkable
 /// </summary>
 /// <param name="StartBlock">Starting block</param>
 public Enemy(MazeBlock StartBlock)
 {
     kinetics          = Kinetic.ZERO();
     kinetics.position = new Vector2(StartBlock.kinetics.boundingBox.Center.X, StartBlock.kinetics.boundingBox.Center.Y);
     sprite            = TreasureHunter.content.Load <Texture2D>(@"PlanetCute\Enemy Bug Small");
     Kinetic.SetBoundingBoxDimensions(ref kinetics.boundingBox, sprite);
     currentBlock = StartBlock;
     target.X     = currentBlock.kinetics.boundingBox.Center.X;
     target.Y     = currentBlock.kinetics.boundingBox.Center.Y;
     startBlock   = StartBlock;
 }
예제 #5
0
        /// <summary>
        /// Constructor
        /// </summary>
        Avatar()
        {
            color     = Color.White;
            hurtTimer = new Timer(.2f);
            hurtTimer.Puase();
            sprite   = TreasureHunter.content.Load <Texture2D>(@"PlanetCute\Character Horn Girl");
            kinetics = new Kinetic(new Vector2(400, 400), new Vector2(0, 0), new Rectangle());
            kinetics.boundingBox.Width  = 31;
            kinetics.boundingBox.Height = 20;
            kinetics.boundingBox.Offset(29, 60);
            kinetics.maxSpeed = 5;

            MazeAdjustment = 0;
        }
예제 #6
0
 /// <summary>
 /// Constructor
 /// </summary>
 Avatar()
 {
     color     = Color.White;
     hurtTimer = new Timer(.2f);
     hurtTimer.Puase();
     sprite   = TreasureHunter.content.Load <Texture2D>(@"PlanetCute\Character Horn Girl");
     kinetics = new Kinetic(new Vector2(400, 400), new Vector2(0, 0), new Rectangle());
     kinetics.boundingBox.Width   = 31;
     kinetics.boundingBox.Height  = 20;
     kinetics.BoundingBoxOffset.X = 29;
     kinetics.BoundingBoxOffset.Y = 60;
     kinetics.maxSpeed            = 7;
     teleport = new Timer(.5f);
     teleport.Start();
     speed = standardSpeed = 5;
 }