- author: AnJung
- date: 2017/06/05
- add some comment in: 2019/06/10
mad with C++
, openGL
, openCV2
.
The openCV2
lib is for opening and storing imgs.
And the openGL
is for 'drawing' the window.
This program use openGL
with GLUT
, but GLUT
is a bit old now. So it's not recommended operate the openGl
with GLUT
now.
This project only took me two weeks to complete(excluding the images). So it is a bit...simple or... er... a mess...
Actually, the game is just beta. I didn't completely finish it.
Just execute the ~bin/Debug/Game0.exe
.
attention There is only debug version, so it might work a bit slow. If you want full experience of the game, compile this with release method. Don't know how? Just Google it and use your brain.
Block |
---|
Point |
all the graphic methods are in this class
Image |
---|
opencv methods |
openGL methods |
Camera |
---|
Block |
some status values |
Character |
---|
Block |
Image |
some methods |
some values |
Player
extend form: Character
Player |
---|
new control key |
define some value |
FlyingRabbit
extend from: Character
FlyingRabbit |
---|
new enemy methods |
define some value |
Enemy |
---|
controls all of the enemy |
PlayerStatu |
---|
store player status |
control player in mainLoop |
the position in all of the Show()
method is using relative pos(real - camera.center)
the max_score
data is stored in the ~bin/Debug/data/max_score.txt
- initialize all (
BackGround
,Enemy
,Player
) - start
GLUT
main loop- show the buffer
- wait a few milliseconds
- get keyBoard keys
if (exit)
then break loop- calculate and update the game staues
if (dead)
then break loop and set status to endGame- draw all the things should be seen on the buffer perspectively
- swap buffer
- END
You might found that the method: Camera.MoveTo()
is never been used. Actually, I originally planed making a scroll map for this game, and the Camera.MoveTo()
is mad for scrolling the screen. Also, the Show
methods is based to the Camera
pos. If you want, you can fork a new_branch, and try to complete this, making this game a real scroll map game.