Assignment 4 - Collision Detection
The time where great minds collide! In this assignment, we are required to create a simple game where objects collide with each other. A Virtual Go-Kart will be modelled and a simple sphere-plane collision detection must be implemented in the game.

The game I implement is "
Watch out for paint patches!"


Description of game:

A renovation work has just been conducted and the careless painter leaves behind patches of paint on the corridor floor. The Go-Kart has to go to the end of the corridor with the shortest move to get the cleaning material so that cleaning up can be performed before the paint dry up.

Goal :     
Move forward and touch the front wall.
The GO-Kart can be controlled by UP, DOWN, RIGHT and LEFT key.

Point System
A total of 100 points are allocated for each new game.Points will be deducted as below:

Note: Drive carefully! There is penalty for poor driving:


      
Penalty                                         Marks deducted

       Collide Against right and left wall                        2
       Run over paint patch                                         3

For every 2 unit moves made by the Go-Kart, 1 point is deducted.
Note: No point is deducted for touching the front wall.



Collision Detection


Collision detection is implemented by checking the current location of the GO-Kart and determing if the next move made will cause any collision with the wall or paint patch. If the coordinate of the GO-Kart equal(or cross) the coordinate of the wall/patch, collision is detected.

If the GO-Kart collide with the right and left wall, it will be prevented from moving further (You cannot move across a wall) and points will be deducted accordingly.

If the GO-Kart touches/cross the paint patch, it can continue moving but points will be deducted accordingly.

If the GO-Kart collide with the front wall, it cannot move forward. Touching the front wall will end the game and the total marks will be revealed in a pop up message box.

Figure 1: A screen shot of the game
Download Area
Assignment 4 (Zip file)
<- Back to Home
Hosted by www.Geocities.ws

1