aboutsummaryrefslogtreecommitdiff
path: root/Space Invaders/GameEngine/GameEngine.cs
diff options
context:
space:
mode:
authorJakob Stendahl <jakob.stendahl@outlook.com>2017-11-12 21:35:43 +0100
committerJakob Stendahl <jakob.stendahl@outlook.com>2017-11-12 21:35:43 +0100
commiteff4413449dc9dfe365ded241c524fe0bab104c2 (patch)
tree58e7514bfa2aaf5cbbb024ca115940fc44dacbb2 /Space Invaders/GameEngine/GameEngine.cs
parent76d19004e770c360feecd7a0f5c9b1c875d44bf1 (diff)
downloadSpace-Invaders-CS-Console-eff4413449dc9dfe365ded241c524fe0bab104c2.tar.gz
Space-Invaders-CS-Console-eff4413449dc9dfe365ded241c524fe0bab104c2.zip
Game is now working in its primitive state
Diffstat (limited to 'Space Invaders/GameEngine/GameEngine.cs')
-rw-r--r--Space Invaders/GameEngine/GameEngine.cs4
1 files changed, 3 insertions, 1 deletions
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<GameObject> GameObjects = new List<GameObject>();
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() {