Skip to content

Commit a8b23f9

Browse files
committed
Update doc/collision_detection.adoc
1 parent ffc0a43 commit a8b23f9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

doc/collision_detection.adoc

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ Collision Detection
44
We already introduced a `isGameOver` function, but it returns always false.
55
The first and only rule for __game over__ in this game is that the game is over when the player collides with any enemy.
66

7-
We therefore need to write a collision detection. To keep things simple, we
7+
We therefore need to write a collision detection. The enemies are composed out of trapezoids. In order to keep it simple we assume that the enemies are sectors of a circle, because that is much easier to work with.
88

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
9+
image:withradius.png[alt=""]
10+
11+
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 (R1) is smaller than the player's radius (plus it's height) and if the enemy's outer radius (R2) is still
1012
larger than the player's radius:
1113

1214

0 commit comments

Comments
 (0)