aboutsummaryrefslogtreecommitdiff
path: root/SuperPolarityMac/BasicGenerator.cs
diff options
context:
space:
mode:
authorBen Beltran <ben@nsovocal.com>2014-02-11 01:15:19 -0600
committerBen Beltran <ben@nsovocal.com>2014-02-11 01:15:19 -0600
commitd7a43ae2d3d4702bd199fa5d8ca84c7c6e78ed36 (patch)
tree28be1c08e360ad3122042243a326f1352797d802 /SuperPolarityMac/BasicGenerator.cs
parent6fceaa7b34f4d6efc497cda51679b37e530a61aa (diff)
Consolidate with mac project.
Diffstat (limited to 'SuperPolarityMac/BasicGenerator.cs')
-rw-r--r--SuperPolarityMac/BasicGenerator.cs77
1 files changed, 0 insertions, 77 deletions
diff --git a/SuperPolarityMac/BasicGenerator.cs b/SuperPolarityMac/BasicGenerator.cs
deleted file mode 100644
index ba51742..0000000
--- a/SuperPolarityMac/BasicGenerator.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.Xna.Framework;
-
-namespace SuperPolarity
-{
- class BasicGenerator
- {
- public enum Ships : byte { Ship, Scout, Battlecruiser };
-
- protected Ships ShipType;
- protected SuperPolarity Game;
- protected int ScoreThreshold;
- protected int Rate;
- protected int CurrentTime;
- protected Random Randomizer;
- protected Vector2 Position;
-
- public void Initialize(SuperPolarity game, Vector2 position, Ships shipType, int rate, int scoreThreshold)
- {
- Game = game;
- ShipType = shipType;
- ScoreThreshold = scoreThreshold;
- Rate = rate;
- Randomizer = new Random();
- Position = position;
- CurrentTime = rate;
- }
-
- public void Update(GameTime gameTime)
- {
- if (ActorManager.CountBaddies() > 50)
- {
- return;
- }
-
- if (Game.Player.Score >= ScoreThreshold)
- {
- CurrentTime = CurrentTime + gameTime.ElapsedGameTime.Milliseconds;
-
- if (CurrentTime >= Rate)
- {
- CurrentTime = 0;
- Spawn();
- }
- }
- }
-
- protected void Spawn()
- {
- var polarity = Ship.Polarity.Positive;
-
- if (Randomizer.Next(2) == 1)
- {
- polarity = Ship.Polarity.Negative;
- }
-
- if (ShipType == Ships.Ship)
- {
- Renderer.CheckIn(ActorFactory.CreateShip(polarity, Position));
- }
-
- if (ShipType == Ships.Scout)
- {
- Renderer.CheckIn(ActorFactory.CreateScout(polarity, Position));
- }
-
- if (ShipType == Ships.Battlecruiser)
- {
- Renderer.CheckIn(ActorFactory.CreateCruiser(polarity, Position));
- }
-
- }
- }
-}