Inheritance: AnimatedSprite
Ejemplo n.º 1
0
 public void LoadContentTest()
 {
     Character target = new Character(); // TODO: Initialize to an appropriate value
     ContentManager theContentManager = null; // TODO: Initialize to an appropriate value
     target.LoadContent(theContentManager);
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
Ejemplo n.º 2
0
 public void CharacterUpdateTest()
 {
     Character target = new Character(); // TODO: Initialize to an appropriate value
     GameTime theGameTime = null; // TODO: Initialize to an appropriate value
     target.CharacterUpdate(theGameTime);
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
Ejemplo n.º 3
0
        //Obtain how far collide with the object and move back to original position
        //For Player sprite
        public void SpriteCollision(ref Character name, SoundEffectInstance song6Inst, SoundEffectInstance song7Inst)
        {
            //Temporary Value for Object position
            Vector2 currentPos;

            //Difference between each objects edges
            Vector2 Diff = new Vector2(0, 0);

            //Obtain difference from Actionhandler
            Diff = CollisionCheck(name.SpriteID);

            //For X axis difference
            if (Math.Abs(Diff.X) > 0)
            {
                //Sounds for colliding into object
                song6Inst.Volume = 1.0f;
                song6Inst.Play();
                currentPos = name.pos;
                currentPos.X -= Diff.X;
                name.pos = currentPos;
            }
            //For Y axis difference
            if (Math.Abs(Diff.Y) > 0)
            {
                //Sounds for colliding into object
                song7Inst.Volume = 1.0f;
                song7Inst.Play();
                currentPos = name.pos;
                currentPos.Y -= Diff.Y;
                name.pos = currentPos;
            }
        }
Ejemplo n.º 4
0
 public void statusTest()
 {
     Character target = new Character();
     int expected = 1;
     int actual;
     target.status = expected;
     actual = target.status;
     Assert.AreEqual(expected, actual);
 }
Ejemplo n.º 5
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

            //Player that can move around
            player = new Character();

            //Background
            BG0 = new Sprite();

            base.Initialize();
        }
Ejemplo n.º 6
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

            //Game starts with the menu
            state = gamestate.menu;

            //Player that can move around
            player = new Character();

            //Backgrounds
            menu = new Sprite();
            BG0 = new Sprite();

            base.Initialize();
        }
Ejemplo n.º 7
0
 public void CharacterConstructorTest()
 {
     Character target = new Character();
     Assert.IsNotNull(target, "character is not created"); //need a better test?
 }
Ejemplo n.º 8
0
 public void CharacterConstructorTest()
 {
     Character target = new Character();
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
Ejemplo n.º 9
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

            //Game starts with the menu
            state = gamestate.menu;

            //Game play starts with start map
            MapState = gamemap.start;
            previousMapState = MapState;

            //Player that can move around
            player = new Character();

            //ID number 0 indicate character that is only one exist.
            player.SpriteID = 0;

            //ID number 2xx indicate Enemy
            Enemy1 = new EnemyCharacter();
            Enemy1.SpriteID = 201;
            Dragon1 = new Dragon();
            Dragon1.SpriteID = 202;
            Enemy2 = new EnemyCharacter();
            Enemy2.SpriteID = 203;
            Enemy3 = new EnemyCharacter();
            Enemy3.SpriteID = 204;
            Enemy4 = new EnemyCharacter();
            Enemy4.SpriteID = 205;

            //ID number 1 indicate PrincessZelda
            Zelda = new PrincessZelda();
            Zelda.SpriteID = 1;

            //Backgrounds
            menu = new Sprite();
            help = new Sprite();
            BG0 = new Sprite();
            Blood = new Sprite();
            Thanks = new Sprite();
            Story1 = new Sprite();
            Story2 = new Sprite();

            //ID 9xx indicate non object sprite
            menu.SpriteID = 901;

            //ID 1xx indicate stationary object
            tree1 = new Sprite(101);
            tree2 = new Sprite(102);
            tree3 = new Sprite(103);
            tree4 = new Sprite(104);
            tree5 = new Sprite(105);

            //ID 5xx indicate Key acition abject that cause some action
            Arrow = new Sprite(501);

            //Action Handling including Collision Detection and EnemySight
            Action = new Collision();

            base.Initialize();
        }
Ejemplo n.º 10
0
Archivo: Game1.cs Proyecto: pvo15/game
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            bg1 = new MainScrolling(Content.Load<Texture2D>("bg1"), new Rectangle(0,0,1024,480));
            bg2 = new MainScrolling(Content.Load<Texture2D>("bg2"), new Rectangle(1024, 0, 1024, 480));

            player = new Character(Content.Load<Texture2D>("walk"), Content.Load<Texture2D>("atack"),Content.Load<SpriteFont>("Font"), new Vector2(100, 375), 44, 40,bg1,bg2);
            bad = new Bad(Content.Load<Texture2D>("bad"), new Vector2(400, 360));

            platform.Add(new Patform(Content.Load<Texture2D>("platform"), new Vector2(150,290)));
            platform.Add(new Patform(Content.Load<Texture2D>("platform"), new Vector2(378, 280)));

            // TODO: use this.Content to load your game content here
        }