Exemplo n.º 1
0
 public ThrowingStar(Vector2 location, bool left)
 {
     factory   = new SpriteFactory();
     sprite    = factory.build(SpriteFactory.sprites.throwingStar);
     position  = location;
     this.left = left;
 }
Exemplo n.º 2
0
        public RightMovingSmallMS(Mario mario)
        {
            ISpriteFactory factory = new SpriteFactory();

            Sprite     = factory.build(SpriteFactory.sprites.rightMovingMarioSmall);
            this.mario = mario;
        }
Exemplo n.º 3
0
        public RightIdleSmallFlipMS(Mario mario)
        {
            ISpriteFactory factory = new SpriteFactory();

            Sprite     = factory.build(SpriteFactory.sprites.rightIdleMarioFlip);
            this.mario = mario;
        }
Exemplo n.º 4
0
        public LeftFireballFireMS(Mario mario)
        {
            ISpriteFactory factory = new SpriteFactory();

            Sprite     = factory.build(SpriteFactory.sprites.leftFireballMarioFire);
            this.mario = mario;
        }
Exemplo n.º 5
0
 // 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);
 }
Exemplo n.º 6
0
        public LeftIdleBigMS(Mario mario)
        {
            ISpriteFactory factory = new SpriteFactory();

            Sprite     = factory.build(SpriteFactory.sprites.leftIdleMarioBig);
            this.mario = mario;
        }
Exemplo n.º 7
0
        public DownWalkingState(Player currentPlayer)
        {
            ISpriteFactory factory = new SpriteFactory();

            Sprite = factory.builder(SpriteFactory.sprites.downWalkingPlayer);
            player = currentPlayer;
        }
Exemplo n.º 8
0
        public LeftMovingSmallFlipMS(Mario mario)
        {
            ISpriteFactory factory = new SpriteFactory();

            Sprite     = factory.build(SpriteFactory.sprites.leftMovingMarioFlip);
            this.mario = mario;
        }
Exemplo n.º 9
0
 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;
 }
Exemplo n.º 10
0
        public LeftMovingTeno(Teno teno)
        {
            ISpriteFactory factory = new SpriteFactory();

            Sprite    = factory.build(SpriteFactory.sprites.leftMovingTeno);
            this.teno = teno;
        }
Exemplo n.º 11
0
        public RightIdleTeno(Teno teno)
        {
            ISpriteFactory factory = new SpriteFactory();

            Sprite    = factory.build(SpriteFactory.sprites.rightIdleTeno);
            this.teno = teno;
        }
Exemplo n.º 12
0
        public RightJumpingFireMS(Mario mario)
        {
            ISpriteFactory factory = new SpriteFactory();

            Sprite     = factory.build(SpriteFactory.sprites.rightJumpingMarioFire);
            this.mario = mario;
        }
Exemplo n.º 13
0
        public RightCrouchingBigMS(Mario mario)
        {
            ISpriteFactory factory = new SpriteFactory();

            Sprite     = factory.build(SpriteFactory.sprites.rightCrouchingMarioBig);
            this.mario = mario;
        }
Exemplo n.º 14
0
 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;
 }
Exemplo n.º 15
0
        public LeftCrouchingSmallMS(Mario mario)
        {
            ISpriteFactory factory = new SpriteFactory();

            Sprite     = factory.build(SpriteFactory.sprites.leftCrouchingMarioSmall);
            this.mario = mario;
        }
Exemplo n.º 16
0
        public RightIdleState(Player currentPlayer)
        {
            ISpriteFactory factory = new SpriteFactory();

            Sprite = factory.builder(SpriteFactory.sprites.rightIdlePlayer);
            player = currentPlayer;
        }
Exemplo n.º 17
0
 public LeftJumpingTeno(Teno teno, Game1 game)
 {
     this.game = game;
     factory   = new SpriteFactory();
     Sprite    = factory.build(SpriteFactory.sprites.leftJumpUpTeno);
     this.teno = teno;
 }
Exemplo n.º 18
0
 public RightFallingTeno(Teno teno, Game1 game)
 {
     this.game = game;
     factory   = new SpriteFactory();
     Sprite    = factory.build(SpriteFactory.sprites.rightJumpFallTeno);
     this.teno = teno;
 }
Exemplo n.º 19
0
 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;
 }
Exemplo n.º 20
0
 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);
 }
Exemplo n.º 21
0
 public void TakeDamage(Enemy hurtEnemy)
 {
     if (!hurtEnemy.isDead)
     {
         sprite           = factory.build(SpriteFactory.sprites.deadBanzaiBill);
         hurtEnemy.isDead = true;
     }
 }
Exemplo n.º 22
0
 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);
 }
Exemplo n.º 23
0
        public LeftIdleTeno(Teno teno, Game1 game)
        {
            this.game = game;
            ISpriteFactory factory = new SpriteFactory();

            Sprite    = factory.build(SpriteFactory.sprites.leftIdleTeno);
            this.teno = teno;
        }
Exemplo n.º 24
0
 public Fireball(Vector2 location, bool left)
 {
     factory   = new SpriteFactory();
     sprite    = factory.build(SpriteFactory.sprites.fireball);
     position  = location;
     this.left = left;
     SoundManager.fireball.Play();
 }
Exemplo n.º 25
0
        public DeadFlipMS(Mario mario)
        {
            ISpriteFactory factory = new SpriteFactory();

            Sprite     = factory.build(SpriteFactory.sprites.deadMario);
            this.mario = mario;
            Game1.GetInstance().gameState = new DeadFlipGameState(mario);
        }
Exemplo n.º 26
0
        public DeadTeno(Teno teno)
        {
            ISpriteFactory factory = new SpriteFactory();

            Sprite    = factory.build(SpriteFactory.sprites.deadTeno);
            this.teno = teno;
            Game1.GetInstance().gameState = new DeadGameState(teno);
        }
Exemplo n.º 27
0
        public RightMovingTeno(Teno teno, Game1 game)
        {
            this.game = game;
            ISpriteFactory factory = new SpriteFactory();

            Sprite    = factory.build(SpriteFactory.sprites.rightRunTeno);
            this.teno = teno;
        }
Exemplo n.º 28
0
 // 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);
 }
Exemplo n.º 29
0
 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));
 }
Exemplo n.º 30
0
 //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);
 }
Exemplo n.º 31
0
        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");
        }
Exemplo n.º 32
0
 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;
 }
Exemplo n.º 33
0
 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;
 }
Exemplo n.º 34
0
 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;
 }
Exemplo n.º 35
0
 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);
 }
Exemplo n.º 36
0
        //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;
        }
Exemplo n.º 37
0
 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;
 }
Exemplo n.º 38
0
 public LedgeTileState(SpriteFactory.sprites sprite)
 {
     factory = new SpriteFactory();
     this.sprite = factory.builder(sprite);
 }
Exemplo n.º 39
0
 public void MarioCrouch()
 {
     spriteFrameCount = MarioConstants.fireMarioCrouchFrameCount;
         marioSprite = FireMarioSpriteFactory.CreateCrouchingMarioSprite(mario.isMovingRight, level, mario.location);
 }
Exemplo n.º 40
0
 public void DisplayInfo(IAnimatedSprite sprite)
 {
     signTexture = sprite;
     displaySign = true;
 }
 public void SetSprite(IAnimatedSprite sprite)
 {
     this.sprite = sprite;
     this.frameTime = sprite.GetFrameTime();
     base.SetSprite(sprite);
 }
Exemplo n.º 42
0
 void execute(IAnimatedSprite sprite)
 {
     sprite.FaceRight();
 }
Exemplo n.º 43
0
 void Execute(IAnimatedSprite sprite)
 {
     sprite.FaceLeft();
 }
Exemplo n.º 44
0
 public void MarioRunRight()
 {
     spriteFrameCount = MarioConstants.fireMarioRunningFrameCount;
     marioSprite = FireMarioSpriteFactory.CreateRunningMarioSprite(mario.isMovingRight, level, nextFrame, mario.location);
 }
Exemplo n.º 45
0
 public void MarioIdle()
 {
     marioSprite = DeadMarioSpriteFactory.CreateDeadMarioSprite(level);
 }
Exemplo n.º 46
0
 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();
 }
Exemplo n.º 47
0
 //Constructor
 public AnimatedSprite(IAnimatedSprite animatedSprite)
 {
     this.animatedSprite = animatedSprite;
 }
Exemplo n.º 48
0
 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);
     }
 }