Joust-a-noid!

Assigned: Tuesday, September 13
Due: Monday, October 3 by 11:59 p.m.


Goals

Joust and Arkanoid are two of the great classics of the early video game era. If you’re unfamiliar with Joust and its unique controls, we recommend trying one of the available online recreations to get a feel for the game play we’ve used as the inspiration for this project.

Your mission is to implement a new game that will combine the unique control style of Joust with a game whose purpose is much like that of Arkanoid (collecting targets at the top of the screen). That’s right: it’s Joust-a-noid! After completing this simple 2-D interactive project, you will hopefully have learned:

  1. How to draw polygonal elements on the screen with OpenGL.

  2. How to texture map polygons.

  3. How to use transformations to move objects.

  4. How to create simple animations and respond to user feedback.

  5. How to perform basic collision detection.

  6. How to simulate an object acting under several forces, including gravity.

And for those of you who think a Joust/Arkanoid hybrid is a weird idea, we give you: JoustPong.

Getting Started

Make sure that you’ve already setup your CSIL account.

We’ve already provided you with some simple demo code. It demonstrates how to get a basic GUI program up and running with our support libraries. It also shows you how to draw a single polygon with a texture mapped onto it. This demo is built on top of the libgfx support library You may wish to add menus or text file support to your program as needed, and the support library has documentation that will help you. We encourage you to read through it.

If you have trouble with any part of the project preparation, please see an instructor or TA during their office hours. Alternatively, post a message on the newsgroup. We usually check the newsgroup regularly and will attempt to respond promptly to questions posted there.

Demo Solution

We are also making a sample solution available. Please remember: you do not have to replicate every last bit of functionality in our sample solution. The goal of this project is not to duplicate our solution. Creative departures from our game, provided that they fulfill the requirements set out below, are strongly encouraged. To run the demo, download the texture pack as well as the executable of your choice. You must download the textures and place the executable in the same folder as the textures for the application to execute properly.

NOTE: Our code is not necessarily bug free. One known bug is that you cannot run the OSX application from the Finder. You must use a shell to run ‘./joust’ in the directory with the textures.

Texture Sets

The textures accompanying our demo are a good place to start. Students are not limited to these textures, and we encourage students to find additional textures.

Using other systems or frameworks

Because libgfx runs on a number of different platforms, using it ought to allow you to develop your code on one system and port it to another. However, we only officially support the library on the Linux machines in the CSIL labs, so if you run into machine- or platform-specific problems on another machine, we may not be able to answer your question. Additionally, you must make sure your code does compile and run on the machines in the CSIL labs.

You may use a different GUI toolkit (e.g., GLUT, MFC) if you like. If you decide to do this you must:

  1. Cleanly separate your GUI code from your project implementation so that the graders can easily find it,
  2. Make sure that we have all the files necessary to compile and run your program, and
  3. Clearly explain in your Readme file how to compile and run your code with your GUI toolkit of choice.

It is also possible to do your project on another platform, but you must receive permission from your TA and arrange how your program can be graded. Otherwise, all projects must be able to compile and run on the Linux machines in the lab.

Requirements

All students must implement the following required features. Notice that students taking the course for 4 credit hours will do a total of 125 points of work, whereas everyone else will do 100.

[20 points] Basic Game Display
You should create an arena of fixed aspect ratio in the window. The world should be populated with: (1) a collection of targets and spikes, (2) the player’s bird, (3) at least one lava pit, and (4) at least one platform. You should draw each of these as one or more polygons. It should be clear which way the bird is facing (texturing can fulfill this requirement). Space should wrap around such that when an object moves off the right or left edge, it reappears on the other side. Objects should bounce off the top of the screen, and the bottom of the screen should be covered by lava pit(s) and platform(s).

[20 points] Texture Mapping
Apply a texture of your choice to the background of the scene— we’ve provided you with the black brick texture. You should also apply a texture to each of your target gems, the spikes and the bird. You should be using alpha channels so as to correctly mask off the parts of the polygon not covered by the texture. You should demonstrate at least 2 distinct target textures. The player’s bird should also have distinct textures for facing left/right, standing, walking, and flapping (our demo contains sample textures for all of these).

[20 points] Bird and Object Collisions
You must detect collisions between the player’s bird and all of the target gems, spikes, platforms, lava, and the ceiling. If the bird hits either a spike or the lava, the game should end (with a notification to the user that they lose). If the bird collides with a gem, the gem should be collected and no longer appear on the screen. After all gems are collected, the user should be notified that they win. Colliding with a platform should cause the bird’s vertical velocity to be set to zero while leaving it’s horizontal velocity the same. It will should also change the bird’s appearance from flying to walking. Hitting the ceiling should cause the bird to bounce back.

[25 points] Bird Physics and Navigation
The bird should move according to basic Newtonian physics. You will need to keep track of the position, velocity, and orientation (right or left) of the bird. When the bird is flying, it should always be affected by a constant gravitational force. You’re free to pick your favorite gravitational constant as long as gravity has an obvious effect on the path of the bird. The bird should be propelled when it flaps its wings. If a user simply flaps the wings (without holding a direction), a vertical force should be applied. If the user is holding right/left and flaps the wings, in addition to an upward force, and force in the right/left direction should also be applied. If the bird is in flight, right/left should ONLY have an affect when the wings are flapped. If the bird is on the platform, then a right/left force can be applied without flapping the wings.

[15 points] Gem and Spike Animation
The gems and spikes should be moving on the screen; however, unlike the bird they need not move in a Newtonian manner. Each gem and spike should move with some velocity. We expect to see, at minimum, 10 spikes and 20 gems. Some gems and spikes must move far enough to wrap around the screen. There should also be at least 3 obviously distinct velocities used among the spikes and gems. For example, in our demo each row has a different velocity.

In order to receive full credit, students taking the course for 4 credit hours must also implement the following additional feature.

[25 points] Heat Seeking Lava Bursts
In this mode, the lava pits shoot lava bursts that are targeted at the bird. These bursts should have an initial velocity that is pointed at the location of the bird. The bird should exert a gravitational force on the lava bursts so that they are drawn toward the bird. If the bird is hit by a burst, the game should end. The lava bursts should disappear if they hit either (1) a platform (2) a gem (3) a spike. Lava burst should also “burn out” and disappear after set amount of time if they have not hit something yet (at least 5 seconds).

Finally, we expect all code to be well designed and well written. It should be easy to follow the logic of your program. Particularly ugly, inscrutable, or ridiculously inefficient code will be penalized.

Tips and Hints

Handing in your Project

Important: Follow all handin instructions carefully. You may lose most or all points if you do not hand in all required files in the proper fashion.

You must turn in the following files:

To actually turn in your finished project, follow the hand-in instructions that we have provided.

Grading

Code-sharing, working together with peers, and copying code from other sources are only allowed under restricted conditions. Make sure you read the code-sharing policy for details.

If a project is handed in late, there will be a 15-point reduction (20 points for 4-credit students) for every 24-hour period after the deadline.

A required part of the grading process will be a live demo of your finished project. We will schedule time slots where some of the course staff will be in the clusters. Demos by individual students will typically take about 10 minutes. During this demo, you will be asked to show us the features of your program. We will not grade your project until it has been demoed.