removed cruft from quickwings

This commit is contained in:
Hartmut Seichter 2024-05-28 23:33:10 +02:00
parent 6abdc90a3a
commit a61d10bb56

View file

@ -1,14 +1,10 @@
/**
* 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_io.hpp>
#include <paradiso/context.hpp>
@ -20,14 +16,7 @@
#include <paradiso/window.hpp>
#include <chrono>
#include <iomanip>
#include <iostream>
#include <thread>
#include <unordered_map>
#include <cstdlib>
#include <ctime>
// #include "lib/image_loader.hpp"
const int frame_rate = 60;
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)}};
paused = true;
}
void update() {
@ -163,7 +152,7 @@ struct Pipe {
shader.set_uniform("pivot", pipe_bottom.pivot);
shader.set_uniform("scale", pipe_bottom.scale);
renderer1.draw(pipe_bottom, shader);
shader.set_uniform("pivot", pipe_top.pivot);
shader.set_uniform("scale", pipe_top.scale);
shader.set_uniform("rotation", pipe_top.rotation);
@ -302,12 +291,12 @@ struct QuickWings {
if (game_over == true) {
paused = true;
}
// Stop game
if (paused) {
return;
}
else {
else {
// Apply gravity
velocity += gravity;
@ -406,7 +395,7 @@ struct Message {
messageSprite.pivot.y() = pos;
}
}
void on_keyboard(const paradiso::Window::KeyboardInputStack& input) {
if (input.size()) {
start = true;
@ -517,7 +506,7 @@ auto main() -> int {
grass.draw(shader);
message.draw(shader);
if (game_over == true) {
if (game_over == true) {
gameover.draw(shader);
}