Skip to content

A side-scroller game based upon Mega Man X, with a priori collision detection, and objects being represented as a sequence of connected points.

Notifications You must be signed in to change notification settings

Darthfett/A-Priori-Physics-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jetpack-Man

Requirements

  • Python 3.2
  • Pygame (1.9.2a0 or higher. Only compatible with x86 versions of python, not x86-64 versions)

How to run

usage: python src/main.py [options]

Runs the game Jetpack-Man

optional arguments:
  -h, --help            show this help message and exit
  -d, --debug           turn debug mode on
  -g, --draw_outlines   draw outlines of images instead of the actual images
  --fps FPS             Change max drawing FPS
  --speed SPEED         Change the speed multiplier
  --bounciness BOUNCINESS
                        Change the bounciness (1 is elastic, 0 is sticky)

Controls

Most of the control scheme and game is not yet implemented.

w, a, d      Activate your Jetpack to accelerate up, left, or right.
q or Escape  Quit the game
r            Press to randomly re-generate the ground terrain.
p            Press to pause/unpause the game.
Spacebar     Press to reset the player's position and velocity.

About

Jetpack-Man is a game created as a learning exercise. The intent of this learning exercise is to create an efficient physics engine.

The physics engine uses line segments to represent all objects -- including the level. It uses a priori/continuous form of collision detection, allowing the precise collision time to be calculated. All object collisions are then stored into an event queue, and evaluated in the order they occur, when they occur.

When objects are moved, or have their acceleration, velocity, or position changed (not as a result of acceleration or velocity), such as via collision, all of their current collisions are invalidated, and new ones are recalculated.

In addition to using a "game" event queue for handling object collisions according to game time, there is a "real" event queue, which handles events that occur in "real" time. This event queue is currently only used to evaluate key press/release events, which are added to the event queue with a timestamp so that they occur at the exact time.

Another objective of Jetpack-Man, other than creating an efficient physics engine, is to keep the game code 'pythonic'. It should follow good coding practices, and the game itself should be fun to play, over keeping a high difficulty.

About

A side-scroller game based upon Mega Man X, with a priori collision detection, and objects being represented as a sequence of connected points.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages