Example #1
0
        public void Bounce(Universe u)
        {
            if (pos.x < 0 || pos.x + image.Width > u.x)
                vel.x = -vel.x;

            if (pos.y < 0 || pos.y + image.Height > u.y)
                vel.y = -vel.y;
        }
Example #2
0
        public GameManager(Form f)
        {
            form = f;
            g = f.CreateGraphics();

            u = new Universe(form.Width, form.Height);
            asteroids = new List<Sprite>();

            form.Paint += new PaintEventHandler(form_Paint);
        }
Example #3
0
        public void Setup()
        {
            asteroids.Add(new Asteroid());
            asteroids.Add(new Asteroid());
            asteroids.Add(new Asteroid());
            asteroids.Add(new Asteroid());

            u = new Universe(Width, Height);
            ship = new Ship();

            controller = new Keyboard(form, ship);
        }