From 18f80f8a7091c7b29b52c39733690f85dbb57f60 Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Thu, 19 Nov 2020 18:52:56 -0500 Subject: [PATCH] lots pewpews, in rotating colors --- Shared/ShmupWorld.cs | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Shared/ShmupWorld.cs b/Shared/ShmupWorld.cs index ec6a2c4..24aaac9 100644 --- a/Shared/ShmupWorld.cs +++ b/Shared/ShmupWorld.cs @@ -14,12 +14,22 @@ namespace SemiColinGames { } public class Shot { - public TextureRef Texture = Textures.Projectile1; + static int color = 0; + public TextureRef Texture; public Vector2 Position; public Vector2 HalfSize = new Vector2(11, 4); public Rectangle Bounds; public Vector2 Velocity; public Shot(Vector2 position, Vector2 velocity) { + Texture = (color % 5) switch { + 0 => Textures.Projectile1, + 1 => Textures.Projectile2, + 2 => Textures.Projectile3, + 3 => Textures.Projectile4, + _ => Textures.Projectile5 + }; + color++; + Position = position; Velocity = velocity; Update(0); // set Bounds @@ -68,8 +78,12 @@ namespace SemiColinGames { if (input[0].Attack && !input[1].Attack) { Vector2 shotOffset = new Vector2(12, 2); Vector2 shotPosition = Vector2.Add(Player.Position, shotOffset); - Shot shot = new Shot(shotPosition, new Vector2(300, 0)); - Shots.Add(shot); + Shots.Add(new Shot(shotPosition, new Vector2(300, 40))); + Shots.Add(new Shot(shotPosition, new Vector2(300, 20))); + Shots.Add(new Shot(shotPosition, new Vector2(300, 0))); + Shots.Add(new Shot(shotPosition, new Vector2(300, -20))); + Shots.Add(new Shot(shotPosition, new Vector2(300, -40))); + new Shot(shotPosition, Vector2.Zero); } Shots.RemoveAll(shot => !Bounds.Intersects(shot.Bounds));