public ThrowingStar(Vector2 location, bool left) { factory = new SpriteFactory(); sprite = factory.build(SpriteFactory.sprites.throwingStar); position = location; this.left = left; }
public RightMovingSmallMS(Mario mario) { ISpriteFactory factory = new SpriteFactory(); Sprite = factory.build(SpriteFactory.sprites.rightMovingMarioSmall); this.mario = mario; }
public RightIdleSmallFlipMS(Mario mario) { ISpriteFactory factory = new SpriteFactory(); Sprite = factory.build(SpriteFactory.sprites.rightIdleMarioFlip); this.mario = mario; }
public LeftFireballFireMS(Mario mario) { ISpriteFactory factory = new SpriteFactory(); Sprite = factory.build(SpriteFactory.sprites.leftFireballMarioFire); this.mario = mario; }
// De constructor public AnimatedSprite(IAnimatedSprite iAnimatedSprite) { this.iAnimatedSprite = iAnimatedSprite; this.sourceRectangle = new Rectangle(this.imageNumber * 32, 0, 32, 32); this.effect = SpriteEffects.None; this.pivot = new Vector2(16f, 16f); }
public LeftIdleBigMS(Mario mario) { ISpriteFactory factory = new SpriteFactory(); Sprite = factory.build(SpriteFactory.sprites.leftIdleMarioBig); this.mario = mario; }
public DownWalkingState(Player currentPlayer) { ISpriteFactory factory = new SpriteFactory(); Sprite = factory.builder(SpriteFactory.sprites.downWalkingPlayer); player = currentPlayer; }
public LeftMovingSmallFlipMS(Mario mario) { ISpriteFactory factory = new SpriteFactory(); Sprite = factory.build(SpriteFactory.sprites.leftMovingMarioFlip); this.mario = mario; }
public WalkingLeftSmallMarioState(IPlayer <IMarioState> mario, int x, int y) { this.Sprite = new MarioAnimation(Textures.mario0, Textures.smallLeftWalking); this.mario = mario; this.x = x; this.y = y; }
public LeftMovingTeno(Teno teno) { ISpriteFactory factory = new SpriteFactory(); Sprite = factory.build(SpriteFactory.sprites.leftMovingTeno); this.teno = teno; }
public RightIdleTeno(Teno teno) { ISpriteFactory factory = new SpriteFactory(); Sprite = factory.build(SpriteFactory.sprites.rightIdleTeno); this.teno = teno; }
public RightJumpingFireMS(Mario mario) { ISpriteFactory factory = new SpriteFactory(); Sprite = factory.build(SpriteFactory.sprites.rightJumpingMarioFire); this.mario = mario; }
public RightCrouchingBigMS(Mario mario) { ISpriteFactory factory = new SpriteFactory(); Sprite = factory.build(SpriteFactory.sprites.rightCrouchingMarioBig); this.mario = mario; }
public WalkingRightBigMarioState(IPlayer <IMarioState> mario, int x, int y) { this.Sprite = new MarioAnimation(Textures.mario0, Textures.bigRightWalking); this.mario = mario; this.x = x; this.y = y; }
public LeftCrouchingSmallMS(Mario mario) { ISpriteFactory factory = new SpriteFactory(); Sprite = factory.build(SpriteFactory.sprites.leftCrouchingMarioSmall); this.mario = mario; }
public RightIdleState(Player currentPlayer) { ISpriteFactory factory = new SpriteFactory(); Sprite = factory.builder(SpriteFactory.sprites.rightIdlePlayer); player = currentPlayer; }
public LeftJumpingTeno(Teno teno, Game1 game) { this.game = game; factory = new SpriteFactory(); Sprite = factory.build(SpriteFactory.sprites.leftJumpUpTeno); this.teno = teno; }
public RightFallingTeno(Teno teno, Game1 game) { this.game = game; factory = new SpriteFactory(); Sprite = factory.build(SpriteFactory.sprites.rightJumpFallTeno); this.teno = teno; }
public BackgroundHolder() { factory = new SpriteFactory(); OverworldSprite = factory.build(SpriteFactory.sprites.overworldBackground); UndergroundSprite = factory.build(SpriteFactory.sprites.undergroundBackground); OverworldHillsSprite = factory.build(SpriteFactory.sprites.overworldHillsBackground); CurrentSprite = OverworldSprite; }
public GUI(Game1 game) { this.game = game; options = new List <KeyValuePair <ICommands, String> >(); font = Game1.gameContent.Load <SpriteFont>(StringHolder.hudPauseFont); factory = new SpriteFactory(); coin = factory.build(SpriteFactory.sprites.coin); }
public void TakeDamage(Enemy hurtEnemy) { if (!hurtEnemy.isDead) { sprite = factory.build(SpriteFactory.sprites.deadBanzaiBill); hurtEnemy.isDead = true; } }
public FireMarioState(Mario mario, Level level) { this.mario = mario; this.level = level; nextFrame = 0; spriteFrameCount = MarioConstants.fireMarioIdleFrameCount; marioSprite = FireMarioSpriteFactory.CreateIdleMarioSprite(mario.isMovingRight, level, mario.location); }
public LeftIdleTeno(Teno teno, Game1 game) { this.game = game; ISpriteFactory factory = new SpriteFactory(); Sprite = factory.build(SpriteFactory.sprites.leftIdleTeno); this.teno = teno; }
public Fireball(Vector2 location, bool left) { factory = new SpriteFactory(); sprite = factory.build(SpriteFactory.sprites.fireball); position = location; this.left = left; SoundManager.fireball.Play(); }
public DeadFlipMS(Mario mario) { ISpriteFactory factory = new SpriteFactory(); Sprite = factory.build(SpriteFactory.sprites.deadMario); this.mario = mario; Game1.GetInstance().gameState = new DeadFlipGameState(mario); }
public DeadTeno(Teno teno) { ISpriteFactory factory = new SpriteFactory(); Sprite = factory.build(SpriteFactory.sprites.deadTeno); this.teno = teno; Game1.GetInstance().gameState = new DeadGameState(teno); }
public RightMovingTeno(Teno teno, Game1 game) { this.game = game; ISpriteFactory factory = new SpriteFactory(); Sprite = factory.build(SpriteFactory.sprites.rightRunTeno); this.teno = teno; }
// Constructor public AnimatedSprite(IAnimatedSprite iAnimatedSprite) { this.iAnimatedSprite = iAnimatedSprite; this.destinationRect = new Rectangle((int)this.iAnimatedSprite.Position.X, (int)this.iAnimatedSprite.Position.Y, 32, 32); this.sourceRect = new Rectangle(this.imageNumber * 32, 0, 32, 32); }
public PlayerGraphicsComponent(GameContext gameContext, ISprite playerShipSprite, IAnimatedSprite thrusterSprite, ISprite lightDamageSprite, ISprite mediumDamageSprite, ISprite heavyDamageSprite) { _gameContext = gameContext ?? throw new ArgumentNullException(nameof(gameContext)); _playerShipSprite = playerShipSprite ?? throw new ArgumentNullException(nameof(playerShipSprite)); _thrusterSprite = thrusterSprite ?? throw new ArgumentNullException(nameof(thrusterSprite)); _lightDamageSprite = lightDamageSprite ?? throw new ArgumentNullException(nameof(lightDamageSprite)); _mediumDamageSprite = mediumDamageSprite ?? throw new ArgumentNullException(nameof(mediumDamageSprite)); _heavyDamageSprite = heavyDamageSprite ?? throw new ArgumentNullException(nameof(heavyDamageSprite)); }
//Properties //Constructor public AnimatedSprite(IAnimatedSprite iAnimatedSprite) { this.iAnimatedSprite = iAnimatedSprite; this.location = iAnimatedSprite.Location; this.texture = iAnimatedSprite.Texture; this.columns = iAnimatedSprite.Columns; this.rows = iAnimatedSprite.Rows; this.totalFrames = this.rows * this.columns; this.framelength = (iAnimatedSprite.FrameLength / 60f); }
public GUI(Game1 game) { this.game = game; options = new List <KeyValuePair <ICommands, String> >(); font = Game1.gameContent.Load <SpriteFont>(StringHolder.hudPauseFont); factory = new SpriteFactory(); coin = factory.build(SpriteFactory.sprites.star); //options.AddRange(new LoadLevelCommand(game.level.levelCurrent, game), "Level 1"); }
public Level(string fileName) { game = new Game1(); builder = new LevelBuilder(this); teno = builder.Build(fileName); game.gameCamera.LookAt(teno.position); collision = new CollisionDetector(teno, game); exitPole = new GateSprite(Game1.gameContent.Load <Texture2D>("gateFramedFinal"), 2, 23); game.gameHUD.Time = ValueHolder.startingTime; }
public Level(Game1 game, string fileName) { this.game = game; levelCurrent = fileName; builder = new LevelBuilder(this, game); teno = builder.Build(fileName); game.gameCamera.LookAt(teno.position); collision = new CollisionDetector(teno, game); exitPole = new GateSprite(Game1.gameContent.Load <Texture2D>("Item/exit"), 1, 1); game.gameHUD.Time = ValueHolder.startingTime; }
public PowerupStarman(Texture2D texture, int rows, int cols, int x, int y) { this.texture = texture; this.Sprite = new SpriteMobileAnimated(texture, rows, cols, x, y); this.x = x; this.y = y; this.rows = rows; this.cols = cols; curFrame = 0; totalFrames = rows * cols; }
public UniversalGUI(Game1 game) { this.game = game; columnOne = new List<KeyValuePair<ICommands, string>>(); columnTwo = new List<KeyValuePair<ICommands, string>>(); defaultOne = new List<KeyValuePair<ICommands, string>>(); defaultTwo = new List<KeyValuePair<ICommands, string>>(); graphicHolder = new List<KeyValuePair<Texture2D, Rectangle>>(); font = Game1.gameContent.Load<SpriteFont>("Fonts/guiFont"); factory = new SpriteFactory(); arrow = factory.builder(SpriteFactory.sprites.arrow); }
//De constructor public AnimatedSprite(IAnimatedSprite iAnimatedSprite) { //nieuwe vector 2 meegegeven in de constructor this.pivot = new Vector2(16f, 16); // Interface classe toegevoegd in de constructor van animatedsprite classe this.iAnimatedSprite = iAnimatedSprite; this.sourceRectangle = new Rectangle(this.imageNumber * 32, 0, 32, 32); //spriteeffect staat op None this.effect = SpriteEffects.None; }
public DeadMarioState(Mario mario, Level level) { this.mario = mario; this.level = level; deathAnimation = MarioConstants.deathAnimation; marioSprite = DeadMarioSpriteFactory.CreateDeadMarioSprite(level); level.gameStatus.lifeCount--; collider.Height = marioSprite.Texture.Height; collider.Width = marioSprite.Texture.Width; collider.X = (int)mario.location.X; collider.Y = (int)mario.location.Y; }
public LedgeTileState(SpriteFactory.sprites sprite) { factory = new SpriteFactory(); this.sprite = factory.builder(sprite); }
public void MarioCrouch() { spriteFrameCount = MarioConstants.fireMarioCrouchFrameCount; marioSprite = FireMarioSpriteFactory.CreateCrouchingMarioSprite(mario.isMovingRight, level, mario.location); }
public void DisplayInfo(IAnimatedSprite sprite) { signTexture = sprite; displaySign = true; }
public void SetSprite(IAnimatedSprite sprite) { this.sprite = sprite; this.frameTime = sprite.GetFrameTime(); base.SetSprite(sprite); }
void execute(IAnimatedSprite sprite) { sprite.FaceRight(); }
void Execute(IAnimatedSprite sprite) { sprite.FaceLeft(); }
public void MarioRunRight() { spriteFrameCount = MarioConstants.fireMarioRunningFrameCount; marioSprite = FireMarioSpriteFactory.CreateRunningMarioSprite(mario.isMovingRight, level, nextFrame, mario.location); }
public void MarioIdle() { marioSprite = DeadMarioSpriteFactory.CreateDeadMarioSprite(level); }
public void MarioJump() { spriteFrameCount = MarioConstants.fireMarioJumpFrameCount; mario.jumpCount = MarioConstants.jumpCount; mario.location.Y -= (int)(0.5*mario.ySpeed); marioSprite = FireMarioSpriteFactory.CreateJumpingMarioSprite(mario.isMovingRight, level, nextFrame, mario.location); level.game.sounds.MarioJump(); }
//Constructor public AnimatedSprite(IAnimatedSprite animatedSprite) { this.animatedSprite = animatedSprite; }
public void MarioIdle() { if (mario.isJumping == false) { if (mario.isCrouching == true) { mario.location.Y -= MarioConstants.spriteHeightCorrection; } mario.isRunning = false; mario.isCrouching = false; spriteFrameCount = MarioConstants.fireMarioIdleFrameCount; marioSprite = FireMarioSpriteFactory.CreateIdleMarioSprite(mario.isMovingRight, level, mario.location); } }