Programming Project #1: Joust!
Due Wednesday of Fifth Week
Introduction
The goal of this project is to reproduce the classic arcade video game
Joust .
In the original game, the player steers a knight riding a flying
ostrich. The goal of the game is to turn enemy knights into eggs by
flying into them from above. The eggs can then be collected for
points.
Our implementation of this game will be a bit simpler than the
original. We won't worry about keeping score. Instead of a single
player against several computer controlled opponents, our version will
pit two human players against each other. The two flying adversaries
(choose any flying character you like) will start out on opposite
sides of the "screen" and the game will end when one of the players
manages to land on top of the other.
One challenging aspect of this project is that we will be recreating a
2d video game in a 3d world. You'll need to exercise special care to
keep all of the objects in your world confined to a single plane.
This will be easier if you use pull-down methods to position objects
instead of using the mouse. For example, you could use "move to" and
"orient to" commands to make sure that all objects are initially at
the same spot and facing in the same direction. If you then position
the objects using "move forward/backward" commands and "move up/down"
commands you can guarantee that all objects will perfectly aligned on
the same plane. You can use similar techniques to ensure that the
camera is squarely facing the plane of the game.
To give you an idea of the sort of layout I have in mind, feel free to
download this example: simple_joust.a2w
. (You are welcome to use my world to write your program, but it will
probably be more interesting if you put together your own.)
This is not a trivial project! Start early! Remember that late days
cannot be applied to programming projects. If you put off getting
started until the last minute, you could easily find yourself stuck
without access to assistance from the instructor or a TA.
Details
-
Controls
Each player will be able to control his or her bird using the
keyboard. The three commands that can be sent to a bird are "go
left", "go right", and "flap".
- go left - if the bird is facing left, it moves forward by a small
amount. if it is facing to the right, it instantly turns 1/2 rotation
to the left and then moves forward. Hint: You should use a boolean
variable to keep track of which direction the bird is currently
facing.
- go right - similar to go left.
- flap - the bird's wings flap once, and the bird moves upward a
small amount.
Each player will use their own set of keys to send these commands to
the appropriate bird. When a bird is not being moved upward by the
flap command, it slowly drifts downward under the force of gravity. It
should not drift below ground level.
-
Obstacles
The original game included several floating platforms that served as
obstacles. Instead of flat platforms, the obstacles in our version of
the game will be floating spheres (collision detection is easier with
spheres). You should arrange 4-6 spheres in the plane of your game.
If a bird encounters a sphere it bounces off harmlessly. We will
spend some time in lab on Thursday of fourth week working on this
bouncing effect. You should make use of a list of obstacles so you
don't need to repeat the collision checking code 4-6 times.
-
Winning the Game
The game ends when the two birds collide. When the collision occurs
you will need to determine which of the two birds is the winner and
which is the loser. The winner is the bird that had the higher
altitude at the time of the collision. The losing bird should be
turned into an egg that falls out of the sky and lands on the ground.
-
Extras
The possibilities are endless...
- Physics - In the original version of the game the birds have momentum. In
other words they slowly pick up speed as they move in one direction,
and they need to slow down before they can change direction to move
the other way. Gravity also has realistic acceleration.
- Score keeping.
- Sound effects.
- Computer controlled opponents.
- An opening screen that explains the controls.
- Wrapping Screen - in the original version of the game any bird that
moves off the left edge reappears on the right, and vice-versa.
Design
As tempting as it is to jump right in and start coding, you'll need to
work out a design on paper beforehand. In developing your design you
should consider which methods should be world level and which should
be class-level. You should figure out where it's appropriate to use
functions. You should sketch out which methods will be associated
with which events. Your design should be organized and legible. For
more guidelines on preparing a design, check out
the design
mini-lab.
It is likely that once you start coding, you will deviate somewhat
from your original design. That's fine; there is no need to update
your design to correspond to the final result.
Handing In
By the start of class on Wednesday of fifth week your project should
be e-mailed to pcutter@kzoo.edu. Your design document should be
handed in at the beginning of that class period.
Grading
The project grade will be broken down as follows:
- Design: 10%
This grade is based on the design
document you will submit with your program.
- Programming Style: 15%
This grade is based on the organization of your code. This relates mainly to the appropriate use
of functions and methods.
- Functionality: 55%
This portion of the grade is based on how well your program meets the specifications outlined above.
- Aesthetics: 10%
This portion of the program is based on how good your program looks. Is the animation smooth? Are the sizes and distributions of objects reasonable?
- Comments: 10%
See the Alice
Documentation and Coding Standards Guide for more information.
- Potential Extra Credit: 5%
Extra credit is available if you choose
to complete tasks from the list of extras outlined above.