You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/collision_detection.adoc
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
Collision Detection
2
2
-------------------
3
3
4
-
We already introcuded a `isGameOver` function, but it returns always false.
4
+
We already introduced a `isGameOver` function, but it returns always false.
5
5
The first and only rule for __game over__ in this game is that the game is over when the player collides with any enemy.
6
6
7
-
We do a simple collision detection where we simplyfy the shape of the enemies to sectors.
7
+
We program a simple collision detection where we simplify the shape of the enemies to sectors.
8
8
9
9
We assume that the player collides with an enemy if the player's angle is inside the segment of the enemey, if enemy's inner radius is smaller than the player's radius and if the enemy's outer radius is still
10
10
larger than the player's radius:
@@ -21,8 +21,8 @@ Now we have a real game!
21
21
== Small Gameplay Tweak
22
22
23
23
In the original game you are not able to rotate into an enemy sideways.
24
-
Without any modification, the player would be game over in our game if he would rotate into an enemy.
24
+
Without any modification, it is game over in our version of the game if The player rotates into an enemy.
25
25
To prevent this we update the `updatePlayer` function.
26
-
We do not update the player's angle, if he would collide with an enemy after rotation:
26
+
We do not update the player's angle, as he would collide with an enemy after rotation:
0 commit comments