public void Draw(SpriteBatch spriteBatch) { _collision.setPosition(_position); _collision.setAngle(_angle); _collision.drawCollisionBox(spriteBatch); //Draw the player, /2 mas tm za rotacijsko tocko, k je nasred sprite-a spriteBatch.Draw(projectileSheet, new Rectangle((int)_position.X, (int)_position.Y, (int)projectileSheet.Width, (int)projectileSheet.Height), null, Color.White, _angle, new Vector2(projectileSheet.Width / 2, projectileSheet.Height / 2), SpriteEffects.None, 0f); //Draw the box for collsion detection }
public void Draw(SpriteBatch spriteBatch) { if (!_isHit) { var sourceRectangle = currentAnimation.CurrentRectangle; spriteBatch.Draw(planetoidsSheet, new Rectangle((int)_actualPos.X, (int)_actualPos.Y, (int)planetWidth / size_reduction, (int)planetHeight / size_reduction), sourceRectangle, Color.White, _angle, new Vector2(planetWidth / 2, planetHeight / 2), SpriteEffects.None, 0f); _collision.setPosition(_actualPos); _collision.setAngle(_angle); _collision.drawCollisionBox(spriteBatch); } }
public void Draw(SpriteBatch spriteBatch) { Console.WriteLine(_angle); if (_isAlive) { //Draw the player, /2 mas tm za rotacijsko tocko, k je nasred sprite-a spriteBatch.Draw(spaceShipsSheet, new Rectangle((int)_position.X, (int)_position.Y, (int)spaceShipsSheet.Width, (int)spaceShipsSheet.Height), null, Color.White, _angle, new Vector2(spaceShipsSheet.Width / 2, spaceShipsSheet.Height / 2), SpriteEffects.None, 0f); //Draw the box for collsion detection _collision.setPosition(_position); _collision.setAngle(_angle); _collision.drawCollisionBox(spriteBatch); } }
public void Draw(SpriteBatch spriteBatch) { if (_isAlive) { var sourceRectangle = currentAnimation.CurrentRectangle; //Draw the player, /2 mas tm za rotacijsko tocko, k je nasred sprite-a spriteBatch.Draw(aiSheet, new Rectangle((int)_position.X, (int)_position.Y, (int)_width * size_amp, (int)_height * size_amp), sourceRectangle, Color.White, _angle, new Vector2(_width / 2, _height / 2), SpriteEffects.None, 0f); //Draw the box for collsion detection _collision.setPosition(_position); _collision.setAngle(_angle); _collision.drawCollisionBox(spriteBatch); } }