Пример #1
0
 /// <summary>
 /// Another simple sprite.
 /// </summary>
 /// <param name="textureName">Lets you specify the name of a texture to load.</param>
 /// <param name="behaviorType">Specify the behavior type.</param>
 /// <param name="newPos">Where the sprite will be on the screen.</param>
 public SimpleSprite(String textureName, constants.SIMPLE_SPRITE_BEHAVIOR behaviorType, Vector2 newPos)
 {
     myTextureName = textureName;
     myVelocity = new Vector2(constants.SIMPLE_SPRITE_SPEED, 0);
     myBehavior = behaviorType;
     globPos = new Rectangle((int)newPos.X, (int)newPos.Y, 0, 0);
 }
Пример #2
0
        /// <summary>
        /// Intermediate constructor which will display with a given state;
        /// </summary>
        /// <param name="newState">What type of gamestate you want this hud to use.</param>
        public HUD(constants.HUDSTATE newState, bool onLeft)
        {
            currentState = newState;
            _isLeft = onLeft;
            _ClipSheet = new Rectangle(0, 0, 612, 49);

            globPos = new Vector2(20, 10);
            if (!onLeft)
            {
                globPos.X = 648;
                globPos.Y = 10;
            }
        }
Пример #3
0
 public void setAnim(constants.AnimType newType)
 {
     // Set the new animation type
     _CurrentAnim = newType;
     _CurrentTStepNum = 0;
     // Start the frame over
     _AnimFrame = 0;
     // Make sure the clipping rectangle knows whats going on
     _ClipSheet.X = (int)animationOffsets[(int)_CurrentAnim].X;
     _ClipSheet.Y = (int)animationOffsets[(int)_CurrentAnim].Y;
 }
Пример #4
0
 public Character(string characterName, bool onLeft, constants.ROBOT_BEHAVIOR robot)
     : this(characterName, onLeft)
 {
     this.myBehavior = robot;
     isRobot = true;
 }
Пример #5
0
 public void startJump(constants.jumpType jumpType)
 {
     if (mySprite.CurrentAnim != constants.AnimType.JUMPING)
     {
         this.setAnim(constants.AnimType.JUMPING);
         myJumpType = jumpType;
         updateJump();
     }
 }
Пример #6
0
 public void setAnim(constants.AnimType newType)
 {
     mySprite.setAnim(newType);
 }
Пример #7
0
 /// <summary>
 /// Intermediate constructor which will display with a given state;
 /// </summary>
 /// <param name="newState">What type of gamestate you want this hud to use.</param>
 public Menu(constants.GAMESTATE newState)
 {
     currentState = newState;
 }
Пример #8
0
 /// <summary>
 /// Another simple sprite.
 /// </summary>
 /// <param name="textureName">Texture for this sprite (the name of)</param>
 /// <param name="behaviorType">Lets you specify a behavior.</param>
 public SimpleSprite(String textureName, constants.SIMPLE_SPRITE_BEHAVIOR behaviorType)
 {
     myTextureName = textureName;
     myVelocity = new Vector2(constants.SIMPLE_SPRITE_SPEED, 0);
     myBehavior = behaviorType;
 }