|
|
@ -9,6 +9,7 @@ namespace SemiColinGames { |
|
|
|
public TextureRef Texture = Textures.Yellow2; |
|
|
|
// Center of player sprite.
|
|
|
|
public Vector2 Position = new Vector2(48, 1080 / 8); |
|
|
|
// TODO: use a bounds rect instead of HalfSize.
|
|
|
|
public Vector2 HalfSize = new Vector2(16, 10); |
|
|
|
|
|
|
|
private float speed = 150f; |
|
|
@ -36,6 +37,13 @@ namespace SemiColinGames { |
|
|
|
} |
|
|
|
return shots; |
|
|
|
} |
|
|
|
|
|
|
|
public void Draw(SpriteBatch spriteBatch) { |
|
|
|
Texture2D texture = Texture.Get; |
|
|
|
Vector2 spriteCenter = new Vector2(texture.Width / 2, texture.Height / 2); |
|
|
|
Vector2 drawPos = Vector2.Floor(Vector2.Subtract(Position, spriteCenter)); |
|
|
|
spriteBatch.Draw(texture, drawPos, Color.White); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public class Shot { |
|
|
@ -68,6 +76,12 @@ namespace SemiColinGames { |
|
|
|
(int) HalfSize.X * 2, |
|
|
|
(int) HalfSize.Y * 2); |
|
|
|
} |
|
|
|
|
|
|
|
public void Draw(SpriteBatch spriteBatch) { |
|
|
|
Texture2D texture = Texture.Get; |
|
|
|
Vector2 center = new Vector2(texture.Width / 2, texture.Height / 2); |
|
|
|
spriteBatch.Draw(texture, Vector2.Floor(Vector2.Subtract(Position, center)), Color.White); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public readonly Rectangle Bounds; |
|
|
|