forked from Hartmut/paradiso
add some notes about design problems in quickwings
This commit is contained in:
parent
aea5ca958a
commit
42a0d56173
1 changed files with 10 additions and 0 deletions
|
@ -19,6 +19,9 @@
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
|
// TODO remove all hard coded 'magic' values!
|
||||||
|
|
||||||
|
// TODO - remove global variables
|
||||||
const int frame_rate = 60;
|
const int frame_rate = 60;
|
||||||
bool game_over = false;
|
bool game_over = false;
|
||||||
float risky_pos_x;
|
float risky_pos_x;
|
||||||
|
@ -38,6 +41,7 @@ struct Background {
|
||||||
|
|
||||||
paradiso::Renderer renderer{};
|
paradiso::Renderer renderer{};
|
||||||
|
|
||||||
|
// TODO no constructors in rule of zero
|
||||||
Background() {
|
Background() {
|
||||||
auto backgroundImage =
|
auto backgroundImage =
|
||||||
paradiso::BitmapIO::get().load("background-day.png");
|
paradiso::BitmapIO::get().load("background-day.png");
|
||||||
|
@ -91,6 +95,8 @@ struct Pipe {
|
||||||
|
|
||||||
bool pos_reset = false;
|
bool pos_reset = false;
|
||||||
|
|
||||||
|
// TODO no constructors in rule of zero
|
||||||
|
|
||||||
Pipe() {
|
Pipe() {
|
||||||
auto pipe_image = paradiso::BitmapIO::get().load("pipe-green.png");
|
auto pipe_image = paradiso::BitmapIO::get().load("pipe-green.png");
|
||||||
|
|
||||||
|
@ -115,6 +121,8 @@ struct Pipe {
|
||||||
|
|
||||||
void update() {
|
void update() {
|
||||||
|
|
||||||
|
// TODO improve state handling
|
||||||
|
|
||||||
if (game_over == true) {
|
if (game_over == true) {
|
||||||
paused = true;
|
paused = true;
|
||||||
}
|
}
|
||||||
|
@ -174,6 +182,7 @@ struct Grass {
|
||||||
paradiso::Renderer renderer1{};
|
paradiso::Renderer renderer1{};
|
||||||
paradiso::Renderer renderer2{};
|
paradiso::Renderer renderer2{};
|
||||||
|
|
||||||
|
// TODO no constructors in rule of zero
|
||||||
Grass() {
|
Grass() {
|
||||||
auto grassImage = paradiso::BitmapIO::get().load("base.png");
|
auto grassImage = paradiso::BitmapIO::get().load("base.png");
|
||||||
grassLeft = paradiso::Sprite{
|
grassLeft = paradiso::Sprite{
|
||||||
|
@ -244,6 +253,7 @@ struct QuickWings {
|
||||||
|
|
||||||
int collision_counter = 0;
|
int collision_counter = 0;
|
||||||
|
|
||||||
|
// TODO no constructors in rule of zero
|
||||||
QuickWings() {
|
QuickWings() {
|
||||||
float scaleh = 0.08f;
|
float scaleh = 0.08f;
|
||||||
float scalew = 0.158f;
|
float scalew = 0.158f;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue