Example #1
0
        private void CheckDeath(Character ch, GameMenu gmenu)
        {
            if (ch.CurrentHealth <= 0)
            {
                if (ch.Life - 1 <= 0)
                {
                    profile.SaveGame.CheckPoint = null;
                    this.Close();
                    gmenu.GameOver();
                }
                else
                {
                    gmenu.LoadLevel(profile.CurrentLocAndLev.CurrentLocation, profile.CurrentLocAndLev.CurrentLevel, true);
                    this.Close();
                }

                this.Dispose();
            }
        }
Example #2
0
        public GameProcess(GameMenu gamemenu, Profile profile, string namelocation, Level level)
        {
            InitializeComponent();
            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true);
            Application.Idle += delegate
            {
                pictureBox1.Invalidate();
            };

            this.gamemenu     = gamemenu;
            this.profile      = profile;
            this.level        = level;
            this.namelocation = namelocation;

            controlball = new GameObject("ControlBall")
            {
                GameSprite = new Sprite(new string[] { "Content\\OtherObjects\\ControlBall.png" })
            };

            LoadSprites(level);
            LoadParametersForm(level);

            backgrounds = new Bitmap[5];

            pichealth = new Bitmap(new Bitmap("Content\\ShowStatHealthAndScoreOfHero\\055.png"), new Size(80, 80));
            glass1    = new Bitmap(new Bitmap("Content\\ShowStatHealthAndScoreOfHero\\2.png"), new Size(200, 35));
            glass2    = new Bitmap(new Bitmap("Content\\ShowStatHealthAndScoreOfHero\\glass.png"), new Size(150, 25));
            score     = new Bitmap(new Bitmap("Content\\ShowStatHealthAndScoreOfHero\\star-gold.png"), new Size(32, 32));
            //background = new Bitmap("Sprites\\123.png");

            backgrounds[0] = new Bitmap("Content\\BackgroundLoad\\1. Летняя поляна.png");
            backgrounds[1] = new Bitmap("Content\\BackgroundLoad\\2. Каньон.jpg");
            backgrounds[2] = new Bitmap("Content\\BackgroundLoad\\3. Зимняя поляна.jpg");
            backgrounds[3] = new Bitmap("Content\\BackgroundLoad\\4. Ночной лес.jpg");
            backgrounds[4] = new Bitmap("Content\\BackgroundLoad\\5. Загадочная земля.png");

            backgronddeath = new Bitmap("Content\\DeathHero\\HeroIsAlive.png");

            profile.Hero.ControlledBot = null;
        }
Example #3
0
 public GamePause(GameProcess gameprocess, GameMenu gamemenu)
 {
     InitializeComponent();
     this.gameprocess = gameprocess;
     this.gamemenu    = gamemenu;
 }
Example #4
0
 public GameOver(GameMenu gm)
 {
     InitializeComponent();
     this.gm = gm;
 }