Пример #1
0
 public Level1_4FloatingBoardClass(SuperMario game, Vector2 position)
 {
     this.Mygame    = game;
     this.Sprite    = new Level1_4FloatingBoardSprite(Mygame.items);
     this.rectangle = new Rectangle((int)position.X, (int)position.Y, sizeX, sizeY);
     velocity       = new Vector2(velocityX, 0);
 }
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (SuperMario game = new SuperMario())
     {
         game.Run();
     }
 }
Пример #3
0
    // Use this for initialization
    void Start()
    {
        marioGO           = GameObject.Find("Little Mario");
        superMarioGO      = GameObject.Find("Super Mario");
        fatMarioGO        = GameObject.Find("Fat Mario");
        duckingMarioGO    = GameObject.Find("Ducking Mario");
        uiManager         = UIManager.uiManager;
        rb                = gameObject.GetComponent <Rigidbody2D>();
        rb.freezeRotation = true;
        //anim = this.gameObject.GetComponent<Animator>();
        //Initialize states
        mario      = new Mario(this, marioGO);
        superMario = new SuperMario(this, superMarioGO, mario);
        fatMario   = new FatMario(this, fatMarioGO, superMario);

        /*walking = new Walking(this);
        *  jumping = new Jumping(this);
        *  inAir = new InAir(this);
        *  ducking = new Ducking(this);*/

        //Set initial states
        myState    = new Walking(this);
        marioState = mario;
        marioState.Enter();
        //Always start in Little Mario
        duckingMarioGO.SetActive(false);
        superMarioGO.SetActive(false);
        fatMarioGO.SetActive(false);
    }
Пример #4
0
 public InfoScreen(SuperMario game, string path)
 {
     this.Mygame          = game;
     game.backgroundColor = Color.Black;
     mySubtitle           = new Subtitle(game, game.spriteBatch, game.Content, path, Color.White);
     nextLevel            = "";
 }
 public FlowerClueClass(SuperMario game, Vector2 position)
 {
     this.Mygame    = game;
     this.Sprite    = new ClueFlowerSprite(game.Content.Load <Texture2D>("clueFlower"));
     this.rectangle = new Rectangle((int)position.X, (int)position.Y, Sprite.Width() / 4, Sprite.Height() / 4);
     mySubtitle     = new Subtitle(game, game.spriteBatch, game.Content, "Content/Subtitle/NaughtyFlower.txt", Color.White);
 }
Пример #6
0
 public MagicNoteClueClass(SuperMario game, Vector2 position)
 {
     this.Mygame    = game;
     this.Sprite    = new MagicNoteSprite(Mygame.note);
     this.rectangle = new Rectangle((int)position.X, (int)position.Y, Sprite.Width(), Sprite.Height());
     mySubtitle     = new Subtitle(game, game.spriteBatch, game.Content, "Content/Subtitle/MagicNote.txt", Color.White);
 }
Пример #7
0
 public FlagpoleClass(SuperMario game, Vector2 position)
 {
     this.Mygame    = game;
     this.Sprite    = new FlagSprite(Mygame.pipes);
     this.rectangle = new Rectangle((int)position.X + 32, (int)position.Y, 4, 400);
     drawRectangle  = new Rectangle((int)position.X, (int)position.Y, 64, 64);
 }
Пример #8
0
 public Level1_4FireClass(SuperMario game, Vector2 position)
 {
     this.Mygame    = game;
     this.Sprite    = new FireSprite(Mygame.enemies);
     pos            = position;
     this.rectangle = new Rectangle((int)position.X, (int)position.Y, 28, 32);
 }
Пример #9
0
 public FlowerClass(SuperMario game, Vector2 position)
 {
     this.Mygame    = game;
     this.Sprite    = new FlowerSprite(Mygame.items);
     this.rectangle = new Rectangle((int)position.X, (int)position.Y, 17, 18);
     velosity       = new Vector2(0, -1);
     timer          = 36;
 }
Пример #10
0
 public KoopaClass(SuperMario game, Vector2 position)
 {
     this.Mygame    = game;
     this.Sprite    = new KoopaLeftSprite(Mygame.enemies);
     this.rectangle = new Rectangle((int)position.X, (int)position.Y, 32, 48);
     pos            = position;
     velocity       = new Vector2(0, 0);
     acceleration   = new Vector2(0, 0);
 }
Пример #11
0
 public StarClass(SuperMario game, Vector2 position)
 {
     this.Mygame    = game;
     this.Sprite    = new StarSprite(Mygame.items);
     this.rectangle = new Rectangle((int)position.X, (int)position.Y, 16, 16);
     acc            = new Vector2(0.0f, 0.2f);
     velocity       = new Vector2(1.5f, -6.0f);
     timer          = 0;
 }
 public GreenMushroomClass(SuperMario game, Vector2 position)
 {
     this.Mygame    = game;
     this.Sprite    = new GreenMushroomSprite(Mygame.items);
     this.rectangle = new Rectangle((int)position.X, (int)position.Y, 32, 32);
     velocity       = new Vector2(1.0f, 0.0f);
     acc            = new Vector2(0.0f, 0.2f);
     timer          = 0;
 }
Пример #13
0
 public Level1_4FireballClass(SuperMario game, Vector2 position)
 {
     this.Mygame    = game;
     this.Sprite    = new Level1_4FireballSprite(Mygame.enemies);
     pos            = position;
     velocity       = new Vector2(0.0f, 0.0f);
     this.rectangle = new Rectangle((int)position.X, (int)position.Y, 48, 16);
     Sound.Instance.BowserFire();
 }
Пример #14
0
 public GoombaClass(SuperMario game, Vector2 position)
 {
     this.Mygame    = game;
     this.Sprite    = new GoombaRunSprite(Mygame.enemies);
     pos            = position;
     velocity       = new Vector2(0.0f, 0.0f);
     acceleration   = new Vector2(0.0f, 0.0f);
     this.rectangle = new Rectangle((int)position.X, (int)position.Y, 32, 32);
 }
Пример #15
0
 public BossPrincess(SuperMario game, Vector2 pos)
 {
     myGame    = game;
     mySprite  = new BossPrincessSprite(myGame.princess);
     rectangle = new Rectangle((int)pos.X, (int)pos.Y, mySprite.Width(), mySprite.Height());
     acc       = new Vector2(0.0f, Utility.Physics_FallingAcc);
     velocity  = new Vector2(0.0f, 0.0f);
     health    = 30;
     ifDead    = false;
 }
Пример #16
0
 public BowserClass(SuperMario game, Vector2 position)
 {
     this.Mygame    = game;
     this.Sprite    = new BowserLeftSprite(Mygame.princess);
     pos            = position;
     velocity       = new Vector2(0.0f, 0.0f);
     acceleration   = new Vector2(0.0f, 0.0f);
     this.rectangle = new Rectangle((int)position.X, (int)position.Y, Sprite.Width(), Sprite.Height());
     health         = 16;
 }
Пример #17
0
 public CoinClass(SuperMario game, Vector2 position)
 {
     this.Mygame    = game;
     this.Sprite    = new CoinSprite(Mygame.items);
     this.rectangle = new Rectangle((int)position.X, (int)position.Y, 10, 15);
     accelerate     = new Vector2(0, 0.4f);
     velosity       = new Vector2(0, -10);
     timer          = 35;
     Used();
 }
Пример #18
0
        public BrickClass(SuperMario game, Vector2 position)
        {
            this.position  = position;
            this.Mygame    = game;
            this.Sprite    = new FloatingBrickSprite(Mygame.blocks);
            this.rectangle = new Rectangle((int)position.X, (int)position.Y, Sprite.Width(), Sprite.Height());

            shaker       = -1;
            velosity     = new Vector2(0, -4);
            acceleration = new Vector2(0, 1);
        }
 public Level1_4UpFireClass(SuperMario game, Vector2 position)
 {
     this.Mygame    = game;
     this.Sprite    = new FireSprite(Mygame.enemies);
     pos            = position;
     velocity       = new Vector2(0, -2f);
     this.rectangle = new Rectangle((int)position.X, (int)position.Y, 28, 32);
     x = rectangle.X;
     y = rectangle.Y;
     Sound.Instance.BowserFire();
 }
    public Mario()
    {
        LifeCount = 1;
        CoinCount = 0;

        smallMario = new SmallMario(this);
        superMario = new SuperMario(this);
        fireMario  = new FireMario(this);
        capeMario  = new CapeMario(this);

        state = smallMario;
    }
Пример #21
0
 public QuestionBlockClass(SuperMario game, Vector2 position, Enum.Itemtype type)
 {
     this.Mygame    = game;
     this.Sprite    = new BlockQuestionSprite(Mygame.items);
     this.rectangle = new Rectangle((int)position.X, (int)position.Y, 32, 32);
     Itemtype       = type;
     ItemNumber     = 1;
     used           = false;
     timer          = 0;
     velosity       = new Vector2(0, -4);
     acceleration   = new Vector2(0, 1);
 }
        public HiddenBlockClass(SuperMario game, Vector2 position)
        {
            this.Mygame    = game;
            this.Sprite    = new HiddenBlockSprite(Mygame.blocks);
            this.rectangle = new Rectangle((int)position.X, (int)position.Y, 32, 32);

            Itemtype     = Enum.Itemtype.GreenMushroom;
            ItemNumber   = 1;
            used         = false;
            timer        = 0;
            velosity     = new Vector2(0, -4);
            acceleration = new Vector2(0, 1);
        }
Пример #23
0
 public Mario(SuperMario game, Vector2 startPosition)
 {
     this.Mygame    = game;
     this.Sprite    = new SMRightIdleSprite(Mygame.texture);
     this.State     = new SMRightIdleState(this);
     this.Position  = new Vector2((float)startPosition.X, (float)startPosition.Y);
     this.rectangle = new Rectangle((int)startPosition.X, (int)startPosition.Y, Utility.mario_width, Utility.mario_height);
     this.acc       = new Vector2(0.0f, Utility.Physics_FallingAcc);
     this.velocity  = new Vector2(0.0f, 0.0f);
     above          = true;
     below          = true;
     left           = true;
     right          = true;
     health         = -1;
 }
Пример #24
0
 public LevelClass(SuperMario game, string fileName)
 {
     this.Mygame     = game;
     ProjectileQueue = new Queue <IProjectile>();
     ItemList        = new List <IItem>();
     FireList        = new List <IFire>();
     EnemyList       = new List <IEnemy>();
     BlockList       = new List <IBlock>();
     BackgroundList  = new List <IBackground>();
     game.infoScreen = false;
     this.loader     = new LevelLoader(this, game);
     myFileName      = fileName;
     Load();
     Mygame.backgroundColor = Color.CornflowerBlue;
     ifSkip = false;
 }
Пример #25
0
 public UnderWorld(SuperMario game, ILevel level, string fileName)
 {
     this.Mygame     = game;
     ProjectileQueue = new Queue <IProjectile>();
     ItemList        = new List <IItem>();
     ItemList.Add(new MagicNoteClueClass(game, new Vector2(680, 350 - 48)));
     EnemyList      = new List <IEnemy>();
     BlockList      = new List <IBlock>();
     FireList       = new List <IFire>();
     BackgroundList = new List <IBackground>();
     this.loader    = new LevelLoader(this, game);
     myFileName     = fileName;
     decoratedLevel = level;
     Mygame.camera.SetPositionZero();
     Load();
     ifSkip = false;
 }
Пример #26
0
 public PrincessInDialog(SuperMario game, Vector2 pos, bool ifGoodEnd)
 {
     myGame    = game;
     mySprite  = new BossPrincessSprite(myGame.princess);
     rectangle = new Rectangle((int)pos.X, (int)pos.Y, mySprite.Width(), mySprite.Height());
     acc       = new Vector2(0.0f, 0.2f);
     velocity  = new Vector2(0.0f, 0.0f);
     health    = 30;
     if (ifGoodEnd)
     {
         myDialog = new Subtitle(game, game.spriteBatch, game.Content, "Content/Subtitle/GoodEndDialog.txt", Color.White, true);
     }
     else
     {
         myDialog = new Subtitle(game, game.spriteBatch, game.Content, "Content/Subtitle/BadEndDialog.txt", Color.White, true);
     }
     ifDead  = false;
     GoodEnd = ifGoodEnd;
 }
        public BrickWithItemsClass(SuperMario game, Vector2 position, Enum.Itemtype type)
        {
            this.Mygame    = game;
            this.Sprite    = new FloatingBrickSprite(Mygame.blocks);
            this.rectangle = new Rectangle((int)position.X, (int)position.Y, 32, 32);

            Itemtype = type;
            if (Itemtype.Equals(Enum.Itemtype.Star))
            {
                ItemNumber = 1;
            }
            else if (Itemtype.Equals(Enum.Itemtype.Coin))
            {
                ItemNumber = 6;
            }
            used         = false;
            timer        = 0;
            velosity     = new Vector2(0, -4);
            acceleration = new Vector2(0, 1);
        }
Пример #28
0
        public Level1_4(SuperMario game, ILevel level, string fileName)
        {
            this.Mygame     = game;
            ProjectileQueue = new Queue <IProjectile>();
            ItemList        = new List <IItem>();
            EnemyList       = new List <IEnemy>();
            BlockList       = new List <IBlock>();
            FireList        = new List <IFire>();
            BackgroundList  = new List <IBackground>();
            bool ifGoodEnd = game.World.clue1Note && game.World.clue2Flower;

            BossPr = new PrincessInDialog(game, new Vector2(4900, 254), ifGoodEnd);

            this.loader = new LevelLoader(this, game);
            myFileName  = fileName;
            ifSkip      = false;
            Mygame.camera.SetPositionZero();
            Load();
            Sound.Instance.StopTheme();
            Sound.Instance.StartTheme();
        }
 public CommandReleaseRight(SuperMario game)
 {
     myGame = game;
 }
Пример #30
0
 public BlockQuestionSprite(SuperMario myGame)
 {
     this.myGame = myGame;
 }