Beispiel #1
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            Time--;
            TimerLabel.Text = "Time: " + Time;
            if (Time > 0 && Points < LevelStandar())
            {
                AnimationObjects.ChangeImage(AnimationObject);
                CheckDown();
                CheckSides();
                CheckPlayerAndGamObejct();
            }
            else
            {
                AnimationObjects.RestarPosition(AnimationObject);
                if (Points < LevelStandar())
                {
                    LabelGameOver.Text = "You Win!";
                }
                else
                {
                    LabelGameOver.Text = "You Lose!";
                }
                LabelGameOver.Visible = true;

                labelNewGame.Visible = true;
                timer1.Stop();
            }
        }
Beispiel #2
0
        private void CheckSides()
        {
            if (SideCollision == false || Collision.LeftWallCollision(WallRight, AnimationObject))
            {
                AnimationObjects.MoveLeft(AnimationObject, checkLevel());

                SideCollision = false;
            }
            if (SideCollision == true || Collision.RightWallCollision(WallLeft, AnimationObject))
            {
                AnimationObjects.MoveRight(AnimationObject, checkLevel());

                SideCollision = true;
            }
        }
Beispiel #3
0
        private void CheckDown()
        {
            if (CollisionDown == false || Collision.UpWallCollision(Walltop, AnimationObject))
            {
                AnimationObjects.MoveDown(AnimationObject, checkLevel());

                CollisionDown = false;
            }
            if (CollisionDown == true || Collision.DownWallCollision(WallDown, AnimationObject))
            {
                test();
                AnimationObjects.MoveUp(AnimationObject, checkLevel());

                CollisionDown = true;
            }
        }