Ejemplo n.º 1
0
        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);
 }
Ejemplo n.º 4
0
 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));
 }
Ejemplo n.º 5
0
 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));
 }
Ejemplo n.º 6
0
 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));
     }
 }