Ejemplo n.º 1
0
		private bool isGravityOn = true;							// Flag to use gravity or not.

		public Shoes(Texture2D texture, State state, int currentFrame, int spriteWidth, int spriteHeight, int totalFrames, SpriteBatch spriteBatch, int screenHeight, int screenWidth, Keys up, Keys left, Keys down, Keys right, ContentManager content)
		{
			this.spriteTexture = texture;       // The sprite sheet we will be drawing from.
			this.state = state;                 // The initial state of the player.
			this.currentFrame = currentFrame;   // The current frame that we are drawing.
			this.spriteWidth = spriteWidth;     // The width of the individual sprite.
			this.spriteHeight = spriteHeight;   // The height of the individual sprite.
			this.totalFrames = totalFrames;     // The total frames in the current sprite sheet.
			this.spriteBatch = spriteBatch;     // The spriteBatch we will use to draw the player.
			this.screenHeight = screenHeight;
			this.screenWidth = screenWidth;
			this.right = right;
			this.left = left;
			this.up = up;
			this.down = down;
			this.content = content;

			gravity = 30f;
			debug = "";
			debug2 = "";

			delayMovementAfterSpringCollisionTimer = new Timer(0.3f);
			delayLaunchAfterLauncherCollisionTimer = new Timer(1f);
			angleInDegreesOfLauncherShoesIsUsing = 0;
		}
Ejemplo n.º 2
0
		public Guy(Texture2D texture, SpriteBatch spriteBatch, int currentFrame, int totalFrames, int spriteWidth, int spriteHeight, int screenHeight, int screenWidth)
		{
			this.spriteBatch = spriteBatch;
			this.Texture = texture;
			this.currentFrame = currentFrame;
			this.totalFrames = totalFrames;
			this.spriteWidth = spriteWidth;
			this.spriteHeight = spriteHeight;
			this.screenHeight = screenHeight;
			this.screenWidth = screenWidth;

			gravity = 10f;
			debug = "";
			debug2 = "";
			collX = 0;
			collY = 0;

			PlayerMode = Mode.Guy;

			delayCollisionWithGuyAndShoesTimer = new Timer(0.5f);
			delayLaunchAfterLauncherCollisionTimer = new Timer(2f);
			delayBetweenLaunchesTimer = new Timer(0.1f);
		}