-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
175 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include "GameOver.h" | ||
|
||
GameOver::GameOver() { | ||
} | ||
|
||
void GameOver::setup() { | ||
|
||
} | ||
|
||
void GameOver::update() { | ||
|
||
} | ||
|
||
void GameOver::draw() { | ||
ofApp::game.draw(); | ||
ofPushStyle(); | ||
ofSetColor(0, 255, 0); | ||
ofDrawBitmapString("Restart: F1", 210, ofGetHeight() - 50); | ||
ofPopStyle(); | ||
} | ||
|
||
void GameOver::inputKey(int key) { | ||
if (key == OF_KEY_F1) { | ||
State::setState(&ofApp::game); | ||
State::getState()->setup(); | ||
return; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,23 @@ | ||
#pragma once | ||
|
||
#include "State.h" | ||
#include "game.h" | ||
|
||
//#include "game.h" | ||
#include "ofApp.h" | ||
#include "State.h" | ||
|
||
class GameOver : public State { | ||
|
||
|
||
public: | ||
|
||
|
||
GameOver() { | ||
|
||
} | ||
|
||
|
||
void setup() { | ||
GameOver(); | ||
|
||
} | ||
void setup(); | ||
|
||
void update() { | ||
void update(); | ||
|
||
} | ||
void draw(); | ||
|
||
void draw() { | ||
ofSetColor(255); | ||
ofDrawBitmapString("game over: ENTER to restart", 6, 12); | ||
} | ||
void inputKey(int key); | ||
|
||
void inputKey(int key) {}; | ||
}; | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include "GamePause.h" | ||
|
||
GamePause::GamePause() { | ||
} | ||
|
||
void GamePause::setup() { | ||
|
||
} | ||
|
||
void GamePause::update() { | ||
|
||
} | ||
|
||
void GamePause::draw() { | ||
ofApp::game.draw(); | ||
ofPushStyle(); | ||
ofSetColor(255, 0, 0); | ||
ofDrawBitmapString("Resume: 'p'", 210, ofGetHeight()-50); | ||
ofPopStyle(); | ||
} | ||
|
||
void GamePause::inputKey(int key) { | ||
if (key == 'p') { | ||
State::setState(&ofApp::game); | ||
return; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#pragma once | ||
|
||
#include "State.h" | ||
#include "ofApp.h" | ||
|
||
|
||
// the start screen | ||
class GamePause : public State { | ||
|
||
public: | ||
|
||
GamePause(); | ||
|
||
void setup(); | ||
|
||
void update(); | ||
|
||
void draw(); | ||
|
||
void inputKey(int key); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include "GameStart.h" | ||
|
||
GameStart::GameStart() { | ||
|
||
} | ||
|
||
void GameStart::setup() { | ||
ofBackground(255); | ||
} | ||
|
||
void GameStart::update() { | ||
|
||
} | ||
|
||
void GameStart::draw() { | ||
|
||
ofBackground(100,100,200); | ||
|
||
ofSetColor(200, 200, 0); | ||
|
||
ofDrawBitmapString("C++ Tetris Game", 40, 50); | ||
ofSetColor(255, 255, 0); | ||
ofDrawBitmapString("LEFT and RIGHT for horizontal movement.", 30, 100); | ||
ofDrawBitmapString("DOWN to move down quickly,", 30, 120); | ||
ofDrawBitmapString("UP arrow for rotations.", 30, 140); | ||
ofDrawBitmapString("SPACE for dropping down.", 30, 160); | ||
ofDrawBitmapString("Pressing 'q' quits the game.", 30, 180); | ||
ofDrawBitmapString("Pressing 'p' pauses the game.", 30, 200); | ||
ofDrawBitmapString("Enter to start the game", 30, 250); | ||
} | ||
|
||
void GameStart::inputKey(int key) { | ||
|
||
if (key == OF_KEY_RETURN) { | ||
State::setState(&ofApp::game); | ||
State::getState()->setup(); | ||
return; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.