public Action GetGunType(int gunType, GameObject g, float speed, float angle) { Action[] gunTypes = new Action[5] { () => Globals.SimpelShot(g, speed, angle, SimpleProjectile.Pattern.Straight), () => Globals.ShotgunShot(g, speed, angle), () => Globals.RocketShot(g, speed, angle), Globals.LaserShot, () => Globals.SimpelShot(g, speed, angle, SimpleProjectile.Pattern.Wave) }; return gunTypes[gunType]; }
public static void Remove(GameObject g) { gameObjectsToRemove.Add(g); }
public static void Add(GameObject g) { gameObjectsToAdd.Add(g); }
public static void RocketShot(GameObject g, float speed, float angle) { GameObjectManager.Add(new Rocket(g.Position, angle, speed, -0.2f, Rocket.Type.Slowing, Vector2.Zero, false)); }
public static void SimpelShot(GameObject g, float speed, float angle, SimpleProjectile.Pattern pattern) { GameObjectManager.Add(new SimpleProjectile(g.Position, angle, speed, Color.LightBlue, pattern, false)); }
public static void ShotgunShot(GameObject g, float speed, float angle) { for (int i = -1; i < 2; i++) { float tmp = (i * 25) * (float)Math.PI / 180; GameObjectManager.Add(new SimpleProjectile(g.Position, tmp + angle, g.Speed + 3, Color.LightBlue, SimpleProjectile.Pattern.Straight, false)); } }