public void SetResolution(Dimension resolution, bool fullscreen = false) { GraphicsDeviceManager.IsFullScreen = fullscreen; GraphicsDeviceManager.PreferredBackBufferWidth = resolution.Width; GraphicsDeviceManager.PreferredBackBufferHeight = resolution.Height; GraphicsDeviceManager.ApplyChanges(); }
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; }
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); }
public Asteroid () { sourceRect = genRandAsteroid(); Position = genRandPosition(); Dimension = new Dimension(sourceRect.Width, sourceRect.Height); Direction = genRandDirection(); Speed = 1f; }
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; }
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(); }
public Camera (Dimension viewPort) { ViewPort = viewPort; }
public Entity (Vector2 position, Dimension dimension, SpriteGroup sprites) { Position = position; Dimension = dimension; Sprites = sprites; }
public Entity(Vector2 position, Dimension dimension) { Position = position; Dimension = dimension; Sprites = new SpriteGroup(this); }
public Entity(Dimension dimension) { Position = Vector2.Zero; Dimension = dimension; Sprites = new SpriteGroup(this); }
public void Render (IRenderable renderable, Vector2 onScreenPosition, Dimension onScreenDimension) { //renderable.Render(onScreenPosition, onScreenDimension); }
public EntityCenteredCamera (Dimension viewPort, Entity target) : base(viewPort) { Target = target; }
public Player(Vector2 position, Dimension dimension) : base(position, dimension, ACCELERATION, MAX_SPEED, ROTATION_SPEED) { }