Beispiel #1
0
 public void SetResolution(Dimension resolution, bool fullscreen = false)
 {
     GraphicsDeviceManager.IsFullScreen = fullscreen;
     GraphicsDeviceManager.PreferredBackBufferWidth = resolution.Width;
     GraphicsDeviceManager.PreferredBackBufferHeight = resolution.Height;
     GraphicsDeviceManager.ApplyChanges();
 }
Beispiel #2
0
 public Ship (Vector2 position, Dimension dimension, float acceleration, float maximumSpeed, float rotationSpeed) 
     : base (position, dimension)
 {
     Acceleration = acceleration;
     RotationSpeed = rotationSpeed;
     MaximumSpeed = maximumSpeed;
     Speed = 0f;
     IsStopped = true;
 }
Beispiel #3
0
        private void createSprite (Rectangle sourceRect)
        {
            Texture2D asteroid = new Texture2D(AzGame.Instance.GraphicsDevice, sourceRect.Width, sourceRect.Height);
            Color[] data = new Color[sourceRect.Width * sourceRect.Height];
            asteroids.GetData(0, sourceRect, data, 0, data.Length);
            asteroid.SetData(data);

            Dimension = new Dimension(asteroid.Width, asteroid.Height);
            Sprites.Add(new Sprite(asteroid), Vector2.Zero);
        }
Beispiel #4
0
        public Asteroid ()
        {
            sourceRect = genRandAsteroid();

            Position = genRandPosition();
            Dimension = new Dimension(sourceRect.Width, sourceRect.Height);

            Direction = genRandDirection();
            Speed = 1f;
        }
Beispiel #5
0
        public Asteroid (Rectangle sourceRect, Vector2 position, Vector2 direction, float speed)
        {
            Scale = 2.0f;
            this.sourceRect = sourceRect;

            Position = position;
            Dimension = new Dimension(sourceRect.Width, sourceRect.Height);

            Direction = direction;
            Speed = speed;
        }
Beispiel #6
0
        public Asteroid (Vector2 position, float speed, float rotation)
        {
            Scale = 2.0f;

            sourceRect = genRandAsteroid();

            Position = position;
            Dimension = new Dimension(sourceRect.Width, sourceRect.Height);

            Speed = speed;
            Rotation = rotation;

            sourceRect = genRandAsteroid();
            Direction = genRandDirection();
        }
Beispiel #7
0
 public Camera (Dimension viewPort)
 {
     ViewPort = viewPort;
 }
Beispiel #8
0
 public Entity (Vector2 position, Dimension dimension, SpriteGroup sprites)
 {
     Position = position;
     Dimension = dimension;
     Sprites = sprites;
 }
Beispiel #9
0
 public Entity(Vector2 position, Dimension dimension)
 {
     Position = position;
     Dimension = dimension;
     Sprites = new SpriteGroup(this);
 }
Beispiel #10
0
 public Entity(Dimension dimension)
 {
     Position = Vector2.Zero;
     Dimension = dimension;
     Sprites = new SpriteGroup(this);
 }
Beispiel #11
0
 public void Render (IRenderable renderable, Vector2 onScreenPosition, Dimension onScreenDimension)
 {
     //renderable.Render(onScreenPosition, onScreenDimension);
 }
 public EntityCenteredCamera (Dimension viewPort, Entity target)
     : base(viewPort)
 {
     Target = target;
 }
Beispiel #13
0
 public Player(Vector2 position, Dimension dimension)
     : base(position, dimension, ACCELERATION, MAX_SPEED, ROTATION_SPEED)
 {
 }