Institute of Computer Science
  1. Courses
  2. 2024/25 fall
  3. Computer Graphics (MTAT.03.015)
ET
Log in

Computer Graphics 2024/25 fall

  • Main
  • Lectures
  • Practices
  • Projects
  • Exam
  • Results
  • Links

First Person Fruit Ninja

Lauri Leppik, Kaur Veere, Martin Koltsov

Repository link: https://github.com/laurileppik/FP-Fruit-Ninja

Initial executable file: https://drive.google.com/drive/folders/197oJB2GfUmJ4YCVmRhbMXpJwDhv0-U1j?usp=sharing

Final release executable file: https://drive.google.com/drive/folders/197oJB2GfUmJ4YCVmRhbMXpJwDhv0-U1j?usp=sharing

Video:

How to run the project:

  1. Download the zip file
  2. Extract the zip file
  3. Run the Fruit_Ninja_1st_Pers.exe file

Description of the project

The goal of this project is to create a fun first-person version of Fruit Ninja. The idea is to implement a realistic cutting animation using procedural geometry, allowing players to slice through fruits in mid-air, avoid bombs, and aim for high scores. The player will use their mouse to slice the flying fruits. Bombs will be randomly thrown into the mix with the fruits. Points are awarded based on the number of fruits sliced.

Inital Progress:

  1. Set up the inital arena where the game will take place.
  2. Added initial models for banana, bomb, orange, watermelon and strawberry.

Final Release:

Added fruit slicing with procedural meshes

When the player makes contact with a fruit (slices it), the following happens:

  1. The fruit mesh is procedurally divided into two halves based on the slice plane's position and normal
  2. The sliced halves are activated with physics simulation, applying impulse and angular velocity to create movement and separation of the pieces.

Added physics for fruit spawning and flying

Every 1.3 seconds (this number seemed to work best for our intentions) a fruit actor is spawned. Its position is based on the position of the player. Each fruit's spawning position is calculated like this:

  1. Take the X and Y coordinates of the player
  2. Decide on the Radius for the circle around the player where fruits will spawn. 500 made sense to us.
  3. Calculate X Offset = Radius * cos(RandomAngle) and Y Offset = Radius * sin(RandomAngle), where RandomAngle is a random angle from 0.0 to 360.0 degrees.
  4. Calculate the X and Y spawning coordinates: X = Player's X + X Offset, Y = Player's Y + Y Offset
  5. The Z coordinate is a constant, that is slightly lower than the player's position so that the fruit would start spawning from under the player.

After all of this, we make a vector out of these 3 coordinates and this is the spawning position of the fruit.

Added scoring

Every time a fruit is sliced, the player is awarded with 100 points. If the player slices a bomb it's game over, the player loses and a losing end screen is displayed. If the player manages to get 10 000 points a winning end screen is displayed.

Added game over screen

Modified fruit models

  • Institute of Computer Science
  • Faculty of Science and Technology
  • University of Tartu
In case of technical problems or questions write to:

Contact the course organizers with the organizational and course content questions.
The proprietary copyrights of educational materials belong to the University of Tartu. The use of educational materials is permitted for the purposes and under the conditions provided for in the copyright law for the free use of a work. When using educational materials, the user is obligated to give credit to the author of the educational materials.
The use of educational materials for other purposes is allowed only with the prior written consent of the University of Tartu.
Terms of use for the Courses environment