Skip to content

First year IT Bachelor group project : create a fruit ninja typing game

Notifications You must be signed in to change notification settings

AdelinePat/typing-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

typing-game

preview main

This project is an implementation of the classic Fruit Ninja game using the Pygame library.

🎮 Features

  • Slice fruits by pressing the corresponding key on your keyboard.
  • Randomly generated fruits with different letters.
  • Physics-based movement for realistic fruit falling.
  • Visual slicing effect when a fruit is cut.
  • Sound effects for a more immersive experience.

Requirements

To run this project, you need to have Python and Pygame installed on your machine.

Install Pygame

You can install Pygame via pip if it's not already installed:

pip install pygame

Project Structure

The project is organised as follows:
Typing-Game/

  • assets\
    • backgrounds\
    • fonts\
    • fruits\
    • plank\
    • sounds\
      • translation.json
  • display_models\
    • _init\
    • diplay_game_elements\
    • display_menu\
    • display-score\
  • scores\
    • game_functions\
    • game_round\
    • game_set\
  • menu\
    • init\
    • in_main_menu\
    • in_score_menu\
    • in_score_menu\
  • main

features

preview game
the game offers serveral features:

assets/

  • backgrounds/: Contains all background images used in the game.
  • bonus_malus/: Contains images for bonus or malus items freeze or bombe power-ups.
  • fonts/: Font files used for displaying game text.
  • plank/:Images for any game UI components, such as the fruit slicing board.
  • props/: contains images for the props that interact with the player(bombs, ice cubes, etc..)

class folder/

  • Button_simple/ : Contains all background images used in the game.
  • Button/: Contains more advanced button functionality for interactive menus.
  • Fruits_slice/: Handles the visual effects when a fruit is sliced.
  • Fruits/: Contains logic for fruit generation, movement, and interactions.
  • Screen/: Handles the screen management, drawing backgrounds, and updates.
  • Sounds/: Controls sound effects in the game (such as fruit slicing, bombs, etc.).
  • translation_manager/: Manages translations for different languages using a JSON file.

display/

  • init/: Initialization for the display.
  • display_menu_assets/: Contains assets and logic for game menus, such as the main menu and in-game UI.

game/

  • menues/: Contains menu logic, including game start, pause, and game over menus.
  • scores/: Manages player attributes, scores, and the high score database (scores.json).

setting/

Game settings file for constants like FPS, screen resolution, fruit list, etc.

main/:

The main script that runs the game.

new_test/

Folder for testing purposes (likely for debugging or feature testing).

translation.json:

JSON file for managing different languages in the game.


How to play

  1. Download the Script: Access the download link and unzip the script

  2. Start the Game: Run new_test.py to launch the game.

  3. Fruit Slicing: When the fruits start falling, press the key corresponding to the letter on the fruit to slice it.

  4. Avoid Bombs: Be carful to avoid bomb, or they will cost you a life.

  5. Use Power-Ups: Some fruits will grant power-ups like ice cubes that freeze the screen, allowing you to slice all fruits present during the freeze duration.

Translations

The game supports multiple languages! Translations are stored in the translation.json file, which you can update with your own language support.

To change the language, simply update the settings in the TranslationManager.


Contributing

This project was made by:

Licence

This project is licensed under the MIT License.

About

First year IT Bachelor group project : create a fruit ninja typing game

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages