PDA

View Full Version : create 2D game in OpenGL



Mikye1
10-18-2011, 12:32 AM
you will implement a video game as described below. You are allowed to implement extra features, as long as you provide sufficient documentation in your README file of how to play the game (Provide a README file with your submission even if you do not add any extra features.)
We will think of the game as taking place in three dimensional space, but the graphics will be drawn in the plane. We have a set of objects, called things. Each thing is drawn as a colored square on the (x,y) plane (but you may design the things however you like). The things move around within a large square window with constant speed. Whenever a thing hits the side of the square it bounces off, while maintaining its speed. For example, if it hits a vertical wall, then the y-component of its velocity is unchanged and the x-component is negated. Initially the things start with random locations and random velocities.
Each thing floats on a certain level, which can be thought of as its z-coordinate. There are 5 different levels for z = 0, 1, 2, 3, 4. Each level contains 4 things initially. There is also one additional level z = 5 called the ground level. On levels 0, 1, 2, live the good things (drawn in yellow) and on levels 3 and 4 live the evil things (drawn in purple).
The objective of the game is to destroy all the evil things (for which you gain points) while destroying as few good things as possible (for which you lose points). To tell differences in level, the darker colors are for lower levels. Things that are at the same level have the same color.
You destroy things by dropping bombs on them. This is done by clicking the left mouse button at the position that you want the bomb to start. A bomb starts at level 0, and slowly falls to each of the other levels until it hits the ground level, where it disappears. A bomb is drawn as a smaller square (or any design that you may have). To indicate the present level of the bomb, its color changes (to match the color of the level) as it falls. When a bomb at level i hits a thing that lives at level i (meaning their squares overlap) the thing is hit and changes color to black to indicate this. About a second later, the thing disappears (meaning that it is destroyed). After a bomb hits a thing, the bomb continues to fall. Score and other status information should be written onto the screen.
The game is terminated either when the user press the q key, or when all the evil things are destroyed. The game can be paused by pressing the middle mouse button, and the game can be single-stepped by pressing the right mouse button.

Alfonse Reinheart
10-18-2011, 01:11 AM
AKA: I'll copy-and-paste my homework into this forum post, so please do it for me.

ugluk
10-18-2011, 03:40 AM
It's easy, stop cheating and go to http://library.nu , if you don't have enough literature.

Alfonse Reinheart
10-18-2011, 10:46 AM
It's easy, stop cheating and go to http://library.nu

It's good how you don't link to any particular book of interest; you just sort of shill the site directly.

ugluk
10-18-2011, 11:01 AM
Here's a link, but does the OP need it? Maybe you know Alfonse.
http://library.nu/docs/UQF7MVB1XN/Beginning%20OpenGL%20Game%20Programming%2C%20Secon d%20Edition

Alfonse Reinheart
10-18-2011, 04:25 PM
You linked to a book who's average rating couldn't even get past 2.5? The Amazon rating is better but it couldn't even break 3.0.

Mikye1
10-18-2011, 07:22 PM
Hello
What do you mean? please let me know.

Mikye1
10-18-2011, 08:18 PM
..

Mikye1
10-18-2011, 08:19 PM
Thank you, I'll update you soon.

ugluk
10-18-2011, 11:11 PM
There's plenty of other GL books on the site, but you need to register. OP, if you want to become a good programmer fast, read this:
http://library.nu/docs/G64R5UYFJ9/OpenGL%204.0%20Shading%20Language%20Cookbook

Alfonse Reinheart
10-19-2011, 01:20 AM
OP, if you want to become a good programmer fast, read this:

Um, no. That's an intermediate-level book. Chapter 2 deals with basic lighting; no beginner would be ready for that after just one chapter.

I'm sure it's a fine book for its intended purpose. But it is not a beginner-level book.

I am curious as to why you don't link to the materials that we as a community maintain (http://www.opengl.org/wiki/Getting_started#Tutorials_and_How_To_Guides), but instead link to sites that you can barely use without registration.

ugluk
10-19-2011, 02:20 AM
Um, no. That's an intermediate-level book. Chapter 2 deals with basic lighting; no beginner would be ready for that after just one chapter.I wonder, which book(s) would you classify as "advanced" then? Can you give examples? Which is the most advanced GL book of them all?

I am curious as to why you don't link to the materials that we as a community maintain, but instead link to sites that you can barely use without registration.Because those resources were generally useless and/or inaccurate to me as a beginner. The best resource was actually this forum and the google searches over it. Otherwise, I think every bit of help helps. The library.nu site is apparently not useless, as the OP thanked us.