2 using System.Collections.Generic;
5 using Microsoft.Xna.Framework;
6 using Microsoft.Xna.Framework.Graphics;
7 using Microsoft.Xna.Framework.Input;
9 namespace SuperPolarity
11 class GameScreen : Screen
13 public GameScreen(SuperPolarity newGame) : base(newGame) {}
15 private BasicGenerator generatorTest;
17 public override void Initialize()
19 InputController.RegisterEventForButton("changePolarity", Buttons.A);
20 InputController.RegisterEventForKey("changePolarity", Keys.Z);
22 InputController.RegisterEventForButton("shoot", Buttons.X);
23 InputController.RegisterEventForKey("shoot", Keys.X);
26 public override void LoadContent()
29 generatorTest = new BasicGenerator();
30 generatorTest.Initialize(Game, new Vector2(100, 600), BasicGenerator.Ships.Scout, 3000, 10);
32 Vector2 playerPosition = new Vector2(Game.GraphicsDevice.Viewport.TitleSafeArea.X, Game.GraphicsDevice.Viewport.TitleSafeArea.Y + Game.GraphicsDevice.Viewport.TitleSafeArea.Height / 2);
34 ActorFactory.CreateMainShip(playerPosition);
35 ActorFactory.CreateShip(Ship.Polarity.Positive, new Vector2(200, 200));
36 ActorFactory.CreateShip(Ship.Polarity.Negative, new Vector2(400, 200));
37 ActorFactory.CreateScout(Ship.Polarity.Negative, new Vector2(500, 500));
38 ActorFactory.CreateCruiser(Ship.Polarity.Positive, new Vector2(40, 40));
41 public override void Update(GameTime gameTime)
43 InputController.UpdateInput();
44 ActorManager.Update(gameTime);
45 generatorTest.Update(gameTime);
48 public override void Draw(SpriteBatch spriteBatch)
50 Renderer.Draw(spriteBatch);