Пример #1
0
 protected override void LoadContent()
 {
     spriteBatch = new SpriteBatch(GraphicsDevice);
     BlockSpriteTextureStorage.Load(this.Content);
     ItemSpriteTextureStorage.Load(this.Content);
     EnemySpriteFactory.Load(this.Content);
     MiscGameObjectTextureStorage.Load(this.Content);
     MarioSpriteFactory.Load(this.Content);
     GUISpriteFactory.Load(this.Content);
     SoundEffectFactory.Load(this.Content);
     MusicFactory.Load(this.Content);
     background         = Content.Load <Texture2D>(UtilityClass.background);
     background2        = Content.Load <Texture2D>(UtilityClass.background2);
     skyworldbackground = Content.Load <Texture2D>("skyworldbackground");
     deathbackground    = Content.Load <Texture2D>(UtilityClass.deathbackground);
     font           = Content.Load <SpriteFont>(UtilityClass.FontString);
     basicarialfont = Content.Load <SpriteFont>(UtilityClass.BasicArialFontString);
     LoadKeyBoardCommands();
     levelStore       = loader.LoadLevel();
     mario            = levelStore.player;
     cameraController = new CameraController(camera, mario);
     resetCommand     = new ResetLevelCommand(this);
     MusicFactory.MainTheme();
     ResetGui();
 }
 public StandingCloudSprite(Vector2 location)
 {
     CloudSpriteSheet   = MiscGameObjectTextureStorage.CreateStandingCloudSprite();
     this.location      = location;
     cloudSprite        = new AnimatedSprite(CloudSpriteSheet, UtilityClass.one, UtilityClass.one, location, UtilityClass.one);
     collisionRectangle = cloudSprite.returnCollisionRectangle();
 }
 public SkyWorldBridgeSprite(Vector2 location)
 {
     SkyWorldBridgeSpriteSheet = MiscGameObjectTextureStorage.CreateBridgeSprite();
     this.location = location;
     BridgeSprite = new AnimatedSprite(SkyWorldBridgeSpriteSheet, UtilityClass.one, UtilityClass.one, location, UtilityClass.one);
     collisionRectangle = BridgeSprite.returnCollisionRectangle();
 }
Пример #4
0
 public RightFacingPipeEdgeSprite(Vector2 location)
 {
     pipeSpriteSheet    = MiscGameObjectTextureStorage.CreateRightFacingPipeEdgeSprite();
     this.location      = location;
     pipeSprite         = new AnimatedSprite(pipeSpriteSheet, UtilityClass.one, UtilityClass.one, location, UtilityClass.one);
     collisionRectangle = pipeSprite.returnCollisionRectangle();
 }
Пример #5
0
 public LargeVineSprite(Vector2 location)
 {
     LargevineSpriteSheet = MiscGameObjectTextureStorage.CreateLargeVineSprite();
     this.location        = location;
     LargevineSprite      = new AnimatedSprite(LargevineSpriteSheet, UtilityClass.one, UtilityClass.one, location, UtilityClass.one);
     collisionRectangle   = LargevineSprite.returnCollisionRectangle();
 }
 public IceSmileyCloudSprite(Vector2 location)
 {
     IceSmileyCloudSpriteSheet = MiscGameObjectTextureStorage.CreateIceCloudSprite();
     this.location             = location;
     AnimIceSmileyCloud        = new AnimatedSprite(IceSmileyCloudSpriteSheet, UtilityClass.one, UtilityClass.one, location, UtilityClass.one);
     collisionRectangle        = AnimIceSmileyCloud.returnCollisionRectangle();
 }
 public MediumVineSprite(Vector2 location)
 {
     MediumvineSpriteSheet = MiscGameObjectTextureStorage.CreateMediumVineSprite();
     this.location         = location;
     MediumvineSprite      = new AnimatedSprite(MediumvineSpriteSheet, UtilityClass.one, UtilityClass.one, location, UtilityClass.one);
     collisionRectangle    = MediumvineSprite.returnCollisionRectangle();
 }
 public GoombaEnemySpawnerSprite(Vector2 location)
 {
     goombaEnemySpawnerSpriteSheet = MiscGameObjectTextureStorage.createGoombaEnemySpawnerSprite();
     this.location         = location;
     spawnerAnimatedSprite = new AnimatedSprite(goombaEnemySpawnerSpriteSheet, UtilityClass.one, UtilityClass.one, location, UtilityClass.one);
     collisionRectangle    = spawnerAnimatedSprite.returnCollisionRectangle();
 }
Пример #9
0
 public SmallVineSprite(Vector2 location)
 {
     smallvineSpriteSheet = MiscGameObjectTextureStorage.CreateSmallVineSprite();
     this.location        = location;
     smallvineSprite      = new AnimatedSprite(smallvineSpriteSheet, UtilityClass.one, UtilityClass.one, location, UtilityClass.one);
     collisionRectangle   = smallvineSprite.returnCollisionRectangle();
 }
 public FlagSprite(Vector2 location)
 {
     this.location   = location;
     moveSpeed       = UtilityClass.flagMoveSpeed;
     flagAtBottom    = false;
     flagSpriteSheet = MiscGameObjectTextureStorage.CreateFlagSprite();
     flagSprite      = new AnimatedSprite(flagSpriteSheet, 1, 1, location, 1);
 }
Пример #11
0
 public BrickPiecesSprite(Vector2 location, bool moveDirection)
 {
     brickPiecesSpriteSheet = MiscGameObjectTextureStorage.CreateBrickPiecesSprite();
     this.location          = location;
     frame                 = UtilityClass.zero;
     totalFrames           = UtilityClass.one;
     spriteSheetSpriteSize = brickPiecesSpriteSheet.Width / UtilityClass.two;
     raiseAndFall          = UtilityClass.brickPiecesRise;
     moveLeftOrRight       = moveDirection;
     collisionRectangle    = new Rectangle(UtilityClass.zero, UtilityClass.zero, UtilityClass.zero, UtilityClass.zero);
 }
        public void PipeTestRight()
        {
            bool passed = true;

            MiscGameObjectTextureStorage.Load(game.Content);
            MarioSpriteFactory.Load(game.Content);
            IPlayer           mario             = new Mario(410, 400);
            IEnviromental     pipe              = new Pipe(400, 400);
            CollisionDetector collisionDetector = new CollisionDetector();
            ICollision        side              = collisionDetector.getCollision(mario.returnCollisionRectangle(), pipe.returnCollisionRectangle());

            if (passed && side.returnCollisionSide().Equals(CollisionSide.Right))
            {
                Console.WriteLine("PipeRight Test Passed");
            }
            else
            {
                Console.WriteLine("PipeRight failed");
            }
        }
Пример #13
0
 public FireballSprite(Vector2 location)
 {
     spriteSheet   = MiscGameObjectTextureStorage.CreateFireballSprite();
     this.location = location;
     sprite        = new AnimatedSprite(spriteSheet, UtilityClass.one, UtilityClass.generalTotalFramesAndSpecializedRows, location, UtilityClass.one);
 }
Пример #14
0
 public PoleSprite(Vector2 location)
 {
     this.location   = location;
     poleSpriteSheet = MiscGameObjectTextureStorage.CreatePoleSprite();
     poleSprite      = new AnimatedSprite(poleSpriteSheet, 1, 1, location, 1);
 }