コード例 #1
0
ファイル: Mario.cs プロジェクト: CurtisHolton1/MarioGame
        public Mario(Game1 game, Scene scene)
        {
            MarioFactory = new MarioFactory(game);
            currentSprite = (MarioSprite)MarioFactory.MakeProduct(1);
            powerupStateFactor = 0;
            actionStateFactor = 1;
            direction = 1;
            idle = new MarioIdleState(this);
            jump = new MarioJumpingState(this);
            walk = new MarioWalkingState(this);
            crouch = new MarioCrouchingState(this);
            fall = new MarioFallingState(this);
            standard = new MarioStandard(this);
            super = new MarioSuper(this);
            fire = new MarioFire(this);
            dead = new MarioDead(this);
            powerupState = standard;
            currentState = idle;
            previousState = currentState;
            previousSprite = currentSprite;
            this.game = game;
            this.scene = scene;
            gravity = scene.Gravity;

            isGrounded = false;

            points = 0;
            coins = 10;
            lives = 3;
            sounds = new SoundMachine(game);
        }
コード例 #2
0
ファイル: Mario.cs プロジェクト: bergerad/Test
        public Mario(Game1 game, int posX, int posY)
        {
            MarioFactory = new MarioFactory(game);
            currentSprite = (MarioSprite)MarioFactory.MakeProduct(1);
            powerupStateFactor = 0;
            actionStateFactor = 1;
            direction = 1;
            idle = new MarioIdleState(this);
            jump = new MarioJumpingState(this);
            walk = new MarioWalkingState(this);
            crouch = new MarioCrouchingState(this);
            fall = new MarioFallingState(this);
            standard = new MarioStandard(this);
            super = new MarioSuper(this);
            fire = new MarioFire(this);
            dead = new MarioDead(this);

            powerupState = standard;
            currentState = idle;
            previousState = currentState;
            previousSprite = currentSprite;

            marioVec.X = posX;
            marioVec.Y = posY;
        }
コード例 #3
0
        public MarioFireBallEntity(MarioFactory factory, Vector2 position)
        {
            FireBall = (Mario1)factory.getSprite((int)MarioTypes.FIREBALL);
            Vector2 vel = new Vector2(20f, 0f);

            FireBall.Velocity = vel;
            FireBall.Position = position;
        }
コード例 #4
0
 public MarioEntity(MarioFactory factory, Vector2 position) : base()
 {
     spriteFactory = factory;
     HUD.MarioLifeTracker.Subscribe(this);
     Mario           = (Mario1)spriteFactory.getSprite((int)MarioTypes.NORMAL);
     Mario.Position  = position;
     Sprite.Position = position;
     Mario.Velocity  = new Vector2(0f, 0f);
 }