示例#1
0
 public OtherCollision(Mario mario, Scene scene, Quadtree quadtree)
 {
     this.scene = scene;
     this.mario = mario;
     this.sprites = scene.SSprites;
     this.movsprites = scene.MovSprites;
     this.quad = quadtree;
     this.sounds = new SoundMachine(scene.Game);
     this.nearObjects = new List<Sprite>();
 }
示例#2
0
 public Sprite(Scene scene, Vector2 position, Texture2D texture, Rectangle sourceRect, int timePerFrame, int numberOfFrames, bool isAnimated)
 {
     this.scene = scene;
        this.isAnimated = isAnimated;
        this.numberOfFrames = numberOfFrames;
        this.position = position;
        this.texture = texture;
        this.timePerFrame = timePerFrame;
        this.sourceRect = sourceRect;
        this.origin.X = 0;
        this.origin.Y = 0;
        Velocity = new Vector2(0, 0);
        blockFactory = new BlockFactory(scene.Game);
        itemFactory = new ItemFactory(scene.Game);
        enemyFactory = new EnemyFactory(scene.Game);
        this.sounds = new SoundMachine(scene.Game);
       // frameWidth = sourceRect.Width / numberOfFrames;
        frameWidth = 16;
        collisionBox = new CollisionBox(position.X, position.Y, 32, SourceRect.Height*2);
 }
示例#3
0
        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);
        }