diff options
author | Jakob Stendahl <jakob.stendahl@outlook.com> | 2017-11-12 19:34:12 +0100 |
---|---|---|
committer | Jakob Stendahl <jakob.stendahl@outlook.com> | 2017-11-12 19:34:12 +0100 |
commit | 91f2f03605f8fc2e3555e18826662754e1ee91a0 (patch) | |
tree | 5670c129372692fc7951d5770287115e0a5e4afa /Space Invaders/Program.cs | |
parent | 4bc687ddbc5f262bcee09bc606fff8f98a10ac0f (diff) | |
download | Space-Invaders-CS-Console-91f2f03605f8fc2e3555e18826662754e1ee91a0.tar.gz Space-Invaders-CS-Console-91f2f03605f8fc2e3555e18826662754e1ee91a0.zip |
[a] Added sick shit!
Diffstat (limited to 'Space Invaders/Program.cs')
-rw-r--r-- | Space Invaders/Program.cs | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/Space Invaders/Program.cs b/Space Invaders/Program.cs index 49244b1..bf9751d 100644 --- a/Space Invaders/Program.cs +++ b/Space Invaders/Program.cs @@ -3,10 +3,58 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using GameEngine; + +namespace SpaceInvaders { -namespace Space_Invaders { class Program { static void Main(string[] args) { + Game SpaceInvaders = new SpaceInvaders(); + SpaceInvaders.Setup(); + SpaceInvaders.Start(); } } + + class SpaceInvaders : Game { + + public override void Setup() { + // This sub is meant for setting the properties of the GameEngine. DO NOT MAKE NEW ONES HERE + // IMPORTANT! You might have to change the console font size, depending on how many rows and columns you want to have! + ConsoleWidth = 600; // Bigger than 15 + ConsoleHeight = 120; // Bigger than 15 + } + + public override void Start() { + // Initialize all gameobjects here + GameObject gameLogic = new GameLogic(); + gameLogic.Parent = this; + GameObjects.Add(gameLogic); + + // Initialize the player + GameObject player = new Player(); + player.Parent = this; + player.xPos = ConsoleWidth / 2 - 10; + player.yPos = 115; + player.Scale = 1; + GameObjects.Add(player); + + // Init a monster + GameObject monster1 = new Monster(); + GameObjects.Add(monster1); + + // Init Obstacles + + for (int i = 0; i < 6; i++) { + GameObject obstacle = new Obstacle(); + player.Parent = this; + obstacle.xPos = 50 + (i * 90); + obstacle.yPos = 90; + GameObjects.Add(obstacle); + } + + base.Start(); // Do start from inherited class, Required for the engine to actually start + } + + } + } |