GithubHelp home page GithubHelp logo

leongrothus / pygame-pinball Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 27.3 MB

Pinball game made with Pygame without collision libraries

License: MIT License

Python 100.00%
game game-development pinball-game python3 arcade arcade-game gravity pygame

pygame-pinball's Introduction

Pinball Game

Description

Welcome to our Pinball game, a modern take on the classic arcade game. The game begins with 5 balls. Players can launch a ball into the playfield by pressing the space bar. The objective is to accumulate as many points as possible. Achieving a score of 5000 points will release the next ball. Subsequent goals are set at 10000 points, 20000 points, and so on. The game only saves the highest score achieved by a player. To prevent cheating, our scoreboard and savegame data are stored as images.

Starting the Game

You can start the Pinball game in two ways:

  1. Run the main function directly.
  2. You can use the "Run Workspace" launch configuration provided for Visual Studio Code. However, please note that this is a debug configuration, and it may cause the game to run slower than usual.

Game Controls

  • Space: Launch a ball (only if there are no balls currently in play)
  • Left/Right Arrow Keys: Operate the flippers
  • Esc: Access the pause menu

Pause Menu

The pause menu allows you to adjust game settings or return to the Main Menu or Options Menu. When you exit to these menus, the current game state is saved and can be resumed later. The pause menu offers the following options:

  • Scale Application: Adjust the game's scale to fit your screen.
  • Change Master Volume: Modify the overall audio volume.
  • Change Music Volume: Adjust the background music volume.
  • Change SFX Volume: Alter the volume of sound effects.

Scoring System

Points are earned by hitting various targets on the playfield. Accumulating a certain number of points will release the next ball into play.

  • Bounce Wall: Each hit on a bounce wall awards between 10 and 25 points
  • Bumper: Hitting the bumpers can give either 50, 100, 150, or 200 points
  • Targets: If all targets are hit, they collectively award 5000 points
  • Spring: Each spring hit gives 25 points, if the ball pases one

Licensing

This project is licensed under the terms of the MIT License. This means that you are free to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, provided that the above copyright notice and this permission notice are included in all copies or substantial portions of the software. However, the software is provided "as is", without any warranty.

Music

The background music used in this game is sourced from this YouTube video.

Sound Effects

The sound effects in this game were created using Sfxr (the web version), a tool for generating sound effects, particularly for video games.

Project Status

This project was developed as a university project and is currently considered finished. The Entity Component System (ECS) was originally implemented in a style similar to Java, but this approach turned out to be unsuitable for Python. There are numerous issues with the current ECS implementation that would require major refactoring to resolve. In addition, the collision system also needs a rework. Currently, each ball calculates its own physics, which is inefficient. A global engine for physics calculations would be a more efficient solution. As such, further development has been halted. If you wish to fork this project or volunteer to maintain or own it, you are welcome to do so.

Dependencies

This project uses several Python libraries. Most of these are part of the standard Python library and should be available in any standard Python environment:

  • abc: Abstract base classes.
  • json: JSON parsing.
  • math: Mathematical functions.
  • os: Operating system dependent functionality.
  • pathlib: Object-oriented filesystem paths.
  • random: Random number generation.
  • sys: System-specific parameters and functions.
  • time: Time-related functions.
  • typing: Type hints (Callables, Generics, TypeVar).

In addition, the project uses the following external libraries:

  • PIL (Pillow): Used for creating and manipulating images.
  • pygame: Used for creating the game, including graphics and sound.

These can be installed via pip, conda, or anything else:

pip install pygame Pillow
conda install pygame Pillow

pygame-pinball's People

Contributors

leongrothus avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.