From eff4413449dc9dfe365ded241c524fe0bab104c2 Mon Sep 17 00:00:00 2001 From: Jakob Stendahl Date: Sun, 12 Nov 2017 21:35:43 +0100 Subject: Game is now working in its primitive state --- Space Invaders/GameEngine/GameEngine.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Space Invaders/GameEngine') diff --git a/Space Invaders/GameEngine/GameEngine.cs b/Space Invaders/GameEngine/GameEngine.cs index bba5838..019b0aa 100644 --- a/Space Invaders/GameEngine/GameEngine.cs +++ b/Space Invaders/GameEngine/GameEngine.cs @@ -12,6 +12,8 @@ namespace GameEngine { public List GameObjects = new List(); public Thread _listnerThread = new Thread(Input.Listner); + public Random Rand = new Random(); + private Graphics _graphics; private bool _running; @@ -139,7 +141,7 @@ namespace GameEngine { int x2 = other.xPos + other.Sprite.GetLength(1); int y1 = other.yPos; int y2 = other.yPos + other.Sprite.GetLength(0); - return (x1 < xPos && xPos < x2 && y1 < yPos && yPos < y2); + return (x1 <= xPos && xPos < x2 && y1 <= yPos && yPos <= y2); } public void ScaleSprite() { -- cgit v1.2.3