aboutsummaryrefslogtreecommitdiff
path: root/Super Polarity/GameScreen.cs
diff options
context:
space:
mode:
authorBen Beltran <ben@nsovocal.com>2013-11-18 21:51:56 -0600
committerBen Beltran <ben@nsovocal.com>2013-11-18 21:51:56 -0600
commit74c155708d85abfc2cf227c08de4f27003015b3f (patch)
tree2e7f6fdad12ae6509832b0e5ee497af7ed72e5e2 /Super Polarity/GameScreen.cs
parent38c7d3f9eb7d63937c6654ff5dd6046ce02dd59c (diff)
I have the worst commits ever.
Diffstat (limited to 'Super Polarity/GameScreen.cs')
-rw-r--r--Super Polarity/GameScreen.cs44
1 files changed, 44 insertions, 0 deletions
diff --git a/Super Polarity/GameScreen.cs b/Super Polarity/GameScreen.cs
new file mode 100644
index 0000000..4404b16
--- /dev/null
+++ b/Super Polarity/GameScreen.cs
@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework.Input;
+
+namespace SuperPolarity
+{
+ class GameScreen : Screen
+ {
+ public GameScreen(SuperPolarity newGame) : base(newGame) {}
+
+ public override void Initialize()
+ {
+ InputController.RegisterEventForButton("changePolarity", Buttons.A);
+ InputController.RegisterEventForKey("changePolarity", Keys.Z);
+
+ InputController.RegisterEventForButton("shoot", Buttons.X);
+ InputController.RegisterEventForKey("shoot", Keys.X);
+ }
+
+ public override void LoadContent()
+ {
+ Vector2 playerPosition = new Vector2(Game.GraphicsDevice.Viewport.TitleSafeArea.X, Game.GraphicsDevice.Viewport.TitleSafeArea.Y + Game.GraphicsDevice.Viewport.TitleSafeArea.Height / 2);
+
+ Renderer.CheckIn(ActorFactory.CreateMainShip(playerPosition));
+ Renderer.CheckIn(ActorFactory.CreateShip(Ship.Polarity.Positive, new Vector2(200, 200)));
+ Renderer.CheckIn(ActorFactory.CreateShip(Ship.Polarity.Negative, new Vector2(400, 200)));
+ }
+
+ public override void Update(GameTime gameTime)
+ {
+ InputController.UpdateInput();
+ ActorManager.Update(gameTime);
+ }
+
+ public override void Draw(SpriteBatch spriteBatch)
+ {
+ Renderer.Draw(spriteBatch);
+ }
+ }
+}