Squirtgun Shooting Gallery

Overview

Basically, this game is a fun way to play around with a particle system based water simulation. The user attempts to knock over targets in the shortest time possible. The game is fully textured and every element is physically modeled.

Instructions

To play the game, run ./spray. For fullscreen mode, run ./spray --fullscreen. In-game controls are simple: control the squirt gun with the mouse and use p to pause. The mouse moves the back of the squirt gun, which rotates around the business end of the barrel.

Controls

KeyFunction
ESCExit the simulation.
pPause the simulation.
Left clickShoot water.
Mouse movementAims the squirt gun.

Implementation

The program makes use of several libraries for graphics, control, and physics operations. SDL provides mouse and keyboard control along with windowing functions. OpenGL, GLU, and GLUT are responsible for 3D graphics. ODE is employed for rigid body dynamics and collision detection with the exception of particle physics. These are handled internally for better control and performance.

The game world is laid out within a box, half of which contains a shooting gallery. Within the shooting gallery, there are a number of platforms, and on these are targets. Each object in the world has a graphical and physical representation, including collision bounding shapes.

Particle System

The game's particle system dynamics are implemented independently of ODE for better performance. A typical particle's life would go something like this:

Targets

Targets appear as cardboard boxes with paper bullseyes stretched over the front. The user attempts to knock these over. For each cycle of the game, the quaternion representing the target's rotation is examined. If the box is rotated enough from its original position, the target starts dying. Eventually, the ball with withdraw from the physical simulation and shrink out of existence.

Screenshots


The initial gallery setup.

Water splashing off of a wall.

A doomed target blinks out of existence.

Oh, the humanity!

A sideways shot knocks a target off of its platform.

Everybody has made water spirals with a hose before. It works here too.

$Id: index.html 444 2006-03-22 17:34:11Z jstrater $