/* * Constructor */ public UserControlledSprite(SpriteSheet spriteSheet, Vector2 position, CollisionOffset collisionOffset, Vector2 speed, Vector2 friction) : base(spriteSheet, position, collisionOffset) { this.speed = speed; this.friction = friction; }
public Platform(Texture2D image, Vector2 position) : base(new SpriteSheet(image,new Point(1, 1),0.5f), new Vector2(600, 600),new CollisionOffset(0, 0, 39, 0)) { spriteSheet = new SpriteSheet(image, new Point(1,1), 0.8f); spriteSheet.addSegment(platformFrameSize, new Point(0, 0), new Point(18, 0), 50); spriteSheet.setCurrentSegment(0); this.position = position; }
// constructor public DbzPlayer(SpriteSheet spriteSheet, Vector2 position, CollisionOffset collisionOffset, Vector2 speed, Vector2 friction, SoundEffect sound1, SoundEffect sound2, Point frameSize, PlayerIndex playerIndex) : base(spriteSheet, position, collisionOffset, speed, friction) { dbzPlayerNum = playerIndex; if (playerIndex.Equals(PlayerIndex.Two)) { base.position.X = 800; effects = SpriteEffects.FlipHorizontally; dbzPlayerKeys.Add(Keys.I); dbzPlayerKeys.Add(Keys.K); dbzPlayerKeys.Add(Keys.J); dbzPlayerKeys.Add(Keys.L); dbzPlayerKeys.Add(Keys.N); dbzPlayerKeys.Add(Keys.O); dbzPlayerKeys.Add(Keys.U); } else { base.position.X = 200; dbzPlayerKeys.Add(Keys.W); dbzPlayerKeys.Add(Keys.S); dbzPlayerKeys.Add(Keys.A); dbzPlayerKeys.Add(Keys.D); dbzPlayerKeys.Add(Keys.Space); dbzPlayerKeys.Add(Keys.E); dbzPlayerKeys.Add(Keys.Q); } dbzFrameSize = frameSize; chargeSound = sound1; ssLoop = sound2; chargeSoundInstance = chargeSound.CreateInstance(); ssLoopInstance = ssLoop.CreateInstance(); ssLoopInstance.IsLooped = true; }
public AutomatedSprite(SpriteSheet spriteSheet, Vector2 position, CollisionOffset collionOffset, Vector2 speed) : base(spriteSheet, position, collionOffset) { this.speed = speed; this.velocity = new Vector2(-1, 0); }
public Sprite(SpriteSheet spriteSheet, Vector2 position, CollisionOffset collisionOffset) { this.spriteSheet = spriteSheet; this.position = position; this.collisionOffset = collisionOffset; }