2024-03-26 16:57:23 +01:00
|
|
|
#include <iostream>
|
|
|
|
#include "bloob.h"
|
|
|
|
|
|
|
|
struct my_game : game {
|
|
|
|
void init(settings& settings);
|
|
|
|
void update();
|
|
|
|
void render(image& target);
|
|
|
|
|
2024-03-28 07:50:49 +01:00
|
|
|
image const* img;
|
|
|
|
ini const* ini;
|
|
|
|
|
2024-03-28 09:39:33 +01:00
|
|
|
|
2024-03-28 07:50:49 +01:00
|
|
|
//tileset tileset;
|
|
|
|
font const* font;
|
2024-03-26 16:57:23 +01:00
|
|
|
double time;
|
|
|
|
};
|
|
|
|
|
|
|
|
void my_game::init(settings& settings) {
|
|
|
|
settings.target_fps = 60;
|
2024-03-28 09:39:33 +01:00
|
|
|
//img = get<image>("test.png");
|
|
|
|
//ini = get<::ini>("test.ini");
|
|
|
|
font = get<::font>("_/default-font-prop.png");
|
2024-03-28 07:50:49 +01:00
|
|
|
//cursor(&font['\\']);
|
2024-03-26 16:57:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void my_game::update() {
|
|
|
|
time += 1.0 / 60.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void my_game::render(image& target) {
|
|
|
|
target.clear(0xffdddd);
|
|
|
|
auto pos = vec2i(std::sin(time * TAU / 4) * 100, std::cos(time * TAU / 4) * 100);
|
|
|
|
//target.draw(img, vec2i(320, 180) + pos, recti(vec2i(8, 14), vec2i(8 * 4, 14 * 4)));
|
2024-03-28 09:39:33 +01:00
|
|
|
//target.draw(img, vec2i::zero);
|
2024-03-26 16:57:23 +01:00
|
|
|
//target.draw(tileset[0xda], vec2i(320, 180) + pos, 0xff00ff);
|
2024-03-28 09:39:33 +01:00
|
|
|
auto str = "Can only be played if\nthere are no card in\nyour draw pile.\nDeal 50 damage to ALL\nenemies.";
|
|
|
|
target.draw(str, vec2i(100, 100) + pos, font, 0xffffff, 0);
|
2024-03-26 18:32:52 +01:00
|
|
|
//target.draw("\\", mouse_pos(), font, 0xffffff, 0);
|
2024-03-26 16:57:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char* argv[]) {
|
|
|
|
my_game game;
|
|
|
|
game.run();
|
|
|
|
return 0;
|
|
|
|
}
|