Пример #1
0
 internal Object(List <Entity> model, Vector2 position, bool static_mode)
 {
     _model      = model;
     eraseble    = true;
     _position   = position;
     is_static   = static_mode;
     boundingBox = Collision.BoundingBox.UpdateBoundingBox(model);
     Program.objects.Add(this);
     id = Program.objects.LastIndexOf(this);
     Program.objects[id].id = id;
     EraseAction            = new TimeAction();
     Draw();
 }
Пример #2
0
        static internal void Main(string[] args)
        {
            gameover  = false;
            objects   = new List <Object>();
            stopwatch = new Stopwatch();
            stopwatch.Start();

            c.noEcho();
            c.SetCursorMode(0);
            c.NoDelay(true);
            UpdateScreenSize(out screen_x, out screen_y);

            Player.CreatePlayer(true);

            // Object box = new Object(new Box().model,new Vector2(5,5),false);
            c.Refresh();
            Player.window = c;
            //Object box2 = new Object(new Box2().model,new Vector2(25,8),false);

            FillCorners();
            time     = new TimeAction();
            grav     = new TimeAction();
            addscore = new TimeAction();



            while (Player.lives > 0)
            {
                deltasec = stopwatch.ElapsedMilliseconds;
                c.Refresh();
                Player.ShowLives();
                Player.ShowScores();
                Player.CheckActions(c.GetKeyDown());
                time.Operation(75, -1, CreateRandomBoxes);
                grav.Operation(25, -1, Gravity);
                addscore.Operation(1000, -1, AddScore);
            }

            GameOver();
        }