Example #1
0
        public void Draw(Vector2 contactPos, SpriteBatch spriteBatch, Camera camera, Vector2 playerPosition)
        {
            frame += speed;

            if (frame >= totalFrames)
            {
                frame -= totalFrames;
            }

            currentFrame = (int)Math.Floor(frame);

            if (drawSimpleBoard)
            {
                SpriteHandler.Draw(simpleBoard, spriteBatch, camera, contactPos + position, 1, rotation, simpleBoardOrigin, Color.White, 1f, SpriteEffects.None, 0f);
            }
            else
            {
                string key;

                if (Game1.CeilAdv(scaleX) == Game1.CeilAdv(scaleY))
                {
                    key = deck;
                }
                else
                {
                    key = tape;
                }

                SpriteHandler.sprites[key].Draw(spriteBatch, camera, new Rectangle((int)(position.X + contactPos.X), (int)(position.Y + contactPos.Y), (int)(width * Math.Abs(scaleX)), (int)(height * Math.Abs(scaleY))), rotation, new Vector2(width * Math.Abs(scaleX) * .5f, height * Math.Abs(scaleY) * .5f), Color.White, 1f, SpriteEffects.None, 0f);
            }
        }
Example #2
0
 /// <summary>
 /// Loads every animation for the player
 /// </summary>
 /// <param name="Content"></param>
 public static void LoadContent(ContentManager Content)
 {
     SpriteHandler.AddSprite("Player_Idle", new Sprite(Content.Load <Texture2D>("idle"), 4, 64, 128));
     SpriteHandler.AddSprite("Player_Jump", new Sprite(Content.Load <Texture2D>("jump"), 15, 64, 128));
     SpriteHandler.AddSprite("Player_JumpCharge", new Sprite(Content.Load <Texture2D>("jumpCharge"), 8, 64, 128));
     SpriteHandler.AddSprite("Player_Accelerate", new Sprite(Content.Load <Texture2D>("accelerate"), 15, 64, 128));
     SpriteHandler.AddSprite("Grind_FiftyFifty", new Sprite(Content.Load <Texture2D>("Grind_FiftyFifty"), 4, 64, 128));
 }
Example #3
0
 /// <summary>
 /// Loads all the decks and tapes, etc
 /// </summary>
 /// <param name="Content"></param>
 public static void LoadContent(ContentManager Content)
 {
     SpriteHandler.AddSprite("Tape_Default", new Sprite(Content.Load <Texture2D>("Tape_Default")));
     SpriteHandler.AddSprite("Deck_Default", new Sprite(Content.Load <Texture2D>("Deck_Default")));
     SpriteHandler.AddSprite("SimpleBoard", new Sprite(Content.Load <Texture2D>("board")));
 }