forked from Hartmut/paradiso
removed cruft from quickwings
This commit is contained in:
parent
6abdc90a3a
commit
a61d10bb56
1 changed files with 7 additions and 18 deletions
|
@ -1,14 +1,10 @@
|
||||||
/**
|
/**
|
||||||
* paradiso - Paradigmen der Softwareentwicklung
|
* paradiso - Paradigmen der Softwareentwicklung
|
||||||
*
|
*
|
||||||
* (c) Copyright 2023 Hartmut Seichter, Robin Rottstädt, brxxh (Hannes Brothuhn)
|
* (c) Copyright 2023-2024 Hartmut Seichter, Robin Rottstädt, brxxh (Hannes Brothuhn)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <bits/iterator_concepts.h>
|
|
||||||
#include <cstdio>
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <ostream>
|
|
||||||
#include <paradiso/bitmap.hpp>
|
#include <paradiso/bitmap.hpp>
|
||||||
#include <paradiso/bitmap_io.hpp>
|
#include <paradiso/bitmap_io.hpp>
|
||||||
#include <paradiso/context.hpp>
|
#include <paradiso/context.hpp>
|
||||||
|
@ -20,14 +16,7 @@
|
||||||
#include <paradiso/window.hpp>
|
#include <paradiso/window.hpp>
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <iomanip>
|
|
||||||
#include <iostream>
|
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <unordered_map>
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <ctime>
|
|
||||||
|
|
||||||
// #include "lib/image_loader.hpp"
|
|
||||||
|
|
||||||
const int frame_rate = 60;
|
const int frame_rate = 60;
|
||||||
bool game_over = false;
|
bool game_over = false;
|
||||||
|
@ -115,7 +104,7 @@ struct Pipe {
|
||||||
.scale = {paradiso::Vector2<float>::make(((500.0f - (500.0f - 52.0f)) / 500.0f) * 2.25f, ((700.0f - (700.0f - 320.0f)) / 700.0f) * 2.25f)}};
|
.scale = {paradiso::Vector2<float>::make(((500.0f - (500.0f - 52.0f)) / 500.0f) * 2.25f, ((700.0f - (700.0f - 320.0f)) / 700.0f) * 2.25f)}};
|
||||||
|
|
||||||
paused = true;
|
paused = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void update() {
|
void update() {
|
||||||
|
@ -163,7 +152,7 @@ struct Pipe {
|
||||||
shader.set_uniform("pivot", pipe_bottom.pivot);
|
shader.set_uniform("pivot", pipe_bottom.pivot);
|
||||||
shader.set_uniform("scale", pipe_bottom.scale);
|
shader.set_uniform("scale", pipe_bottom.scale);
|
||||||
renderer1.draw(pipe_bottom, shader);
|
renderer1.draw(pipe_bottom, shader);
|
||||||
|
|
||||||
shader.set_uniform("pivot", pipe_top.pivot);
|
shader.set_uniform("pivot", pipe_top.pivot);
|
||||||
shader.set_uniform("scale", pipe_top.scale);
|
shader.set_uniform("scale", pipe_top.scale);
|
||||||
shader.set_uniform("rotation", pipe_top.rotation);
|
shader.set_uniform("rotation", pipe_top.rotation);
|
||||||
|
@ -302,12 +291,12 @@ struct QuickWings {
|
||||||
if (game_over == true) {
|
if (game_over == true) {
|
||||||
paused = true;
|
paused = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop game
|
// Stop game
|
||||||
if (paused) {
|
if (paused) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Apply gravity
|
// Apply gravity
|
||||||
velocity += gravity;
|
velocity += gravity;
|
||||||
|
|
||||||
|
@ -406,7 +395,7 @@ struct Message {
|
||||||
messageSprite.pivot.y() = pos;
|
messageSprite.pivot.y() = pos;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_keyboard(const paradiso::Window::KeyboardInputStack& input) {
|
void on_keyboard(const paradiso::Window::KeyboardInputStack& input) {
|
||||||
if (input.size()) {
|
if (input.size()) {
|
||||||
start = true;
|
start = true;
|
||||||
|
@ -517,7 +506,7 @@ auto main() -> int {
|
||||||
grass.draw(shader);
|
grass.draw(shader);
|
||||||
message.draw(shader);
|
message.draw(shader);
|
||||||
|
|
||||||
if (game_over == true) {
|
if (game_over == true) {
|
||||||
gameover.draw(shader);
|
gameover.draw(shader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue