600.357/600.457 Assignment 1
Handed out: Sep 16
Due: Oct 6, 4pm.
457 students,
turn in your assignment here
357 students,
turn in your assignment here
Documented source and a README file must be included. If you use unix,
include a Makefile. If you use windows, include the project.
Note1: 20% of your grade will be depend on the design, readability and
documentation of your program.
In this program you will get to implement a basic openGL based game
of 3D Tetris. This game requires the user to arrange shapes.
The user starts with a 10 units by 10 units wide can that is 100
units high.
A sequence of the bricks from a library of shapes are randomly
generated. This library must contain at least the following bricks:
- cube: 2u x 2u x 2u
- bonus cube: 1u x 1u x 1u
- i-shape: 1u x 1u x 4u cuboid
- L-bracket: 1u x 1u x 1u cube with two 1u x 1u x 2u cuboids
attached to two of its perpendicular faces
- Star: 1u x 1u x 1u cube with six other 1u x 1u x 1u cubes
on six of its faces
Use face normals for lighting.
Game Rule
A brick starts falling from the top and stops when it collides
with another shape. The starting location of the brick is chosen
randomly by the program. The users are able to translate and rotate
the brick as it falls until it collides another. Their goal is
to arrange them in a way that they form filled layers. A layer
is full if all 10u x 10u space is filled by part of some brick.
If one or more layers are full, the whole layer disappears and the
bricks from above fall down to the next level.
The game ends if the next brick collides another before falling
any distance.
Scoring
For the difficulty level L, the user gets 5*L points for clearing one,
20*L for clearing two, 60*L for clearing three and 150*L for clearing
four levels together. The difficulty level increases by one after 5
levels have been cleared. The falling speed of the bricks also increases
with each difficulty level.
The user can control the bricks by arrow and other keys. The view
of the can will be controlled by the mouse. Implement a motion that
responds to mouse drag. Rotate about a vertical axis for sideways
mouse motion and about a horizontal axis for an up-down mouse motion.
(The container is transparent so that the bricks may be seen.)
457 Extras
457 students need to implement specially shaded bricks: Use an RGBA
texture to turn bricks into hollow shapes with cross-wire pattern
on their walls.
457 students, also compute average vertex normals and use for lighting.
General Tips
Changing the difficulty level is not crucial. Implement that only if
you finish the rest.
-- The URL of this page is: http://www.cs.jhu.edu/~subodh/457/asn1.html --