summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2023-03-26 04:20:04 -0400
committerrealtradam <[email protected]>2023-03-26 04:20:04 -0400
commitfaf412bbdb763799979dd1f8360c3dd7750d5fff (patch)
treedfd37356d6acd4e80550cfc08db8fc5ad6cf9c7a
parente14efe058ff361e2fed1c6cfdf9f49801156e99b (diff)
downloadrodeo_sample_game-faf412bbdb763799979dd1f8360c3dd7750d5fff.tar.gz
rodeo_sample_game-faf412bbdb763799979dd1f8360c3dd7750d5fff.zip
rodeo bump + orcmark
m---------external/RodeoEngine0
-rw-r--r--src/main.c62
2 files changed, 61 insertions, 1 deletions
diff --git a/external/RodeoEngine b/external/RodeoEngine
-Subproject 4670ac42a773ea97157f71d78687f79d6ba3c1d
+Subproject 6a0ef52763cee6e6d7c631516461e0600d9a2da
diff --git a/src/main.c b/src/main.c
index 2a5efe1..943abce 100644
--- a/src/main.c
+++ b/src/main.c
@@ -5,15 +5,20 @@
rodeo_string_t renderer;
float time_var;
+/*
const uint8_t texture_memory[] = {
0x00, 0xff, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff,
0xff, 0xff, 0x00, 0xff,
0xff, 0xff, 0xff, 0x99,
};
+*/
rodeo_texture_2d_t texture;
+rodeo_vector2_t units[UINT16_MAX][2] = {0};
+uint16_t num_of_units = 0;
+
const rodeo_color_RGBAFloat_t red =
{
.red = 1.0f, .green = 0.0f, .blue = 0.0f,
@@ -100,6 +105,54 @@ main_loop(void)
);
float orc_size[] = {13.0f * 2.0f, 19.0f * 2.0f};
+
+ for(uint8_t i = 0; i < 10; ++i)
+ {
+ if((num_of_units < UINT16_MAX) && (rodeo_frame_perSecond_get() > 40))
+ {
+ num_of_units += 1;
+ units[num_of_units - 1][0] = (rodeo_vector2_t){ {
+ (float)rodeo_input_mouse_x_get() - (orc_size[0] / 2.0f),
+ (float)rodeo_input_mouse_y_get() - (orc_size[1] / 2.0f)
+ } };
+ units[num_of_units - 1][1] = (rodeo_vector2_t){ {
+ (float)((int8_t)(rodeo_random_uint64_get() % 10) - 5),
+ (float)((int8_t)(rodeo_random_uint64_get() % 10) - 5)
+ } };
+ }
+ }
+
+ for(uint64_t i = 0; i < num_of_units; ++i)
+ {
+ units[i][0].x += units[i][1].x;
+ units[i][0].y += units[i][1].y;
+ if(units[i][0].x > rodeo_screen_width_get() - orc_size[0] || units[i][0].x < 0)
+ {
+ units[i][1].x = -units[i][1].x;
+ }
+ if(units[i][0].y > rodeo_screen_height_get() - orc_size[1] || units[i][0].y < 0)
+ {
+ units[i][1].y = -units[i][1].y;
+ }
+
+ rodeo_texture_2d_draw(
+ &(rodeo_rectangle_t){
+ .x = units[i][0].x,
+ .y = units[i][0].y,
+ .width = orc_size[0],
+ .height = orc_size[1],
+ },
+ &(rodeo_rectangle_t){
+ .x = 5,
+ .y = 5,
+ .width = 13,
+ .height = 19
+ },
+ NULL,
+ &texture
+ );
+ }
+
rodeo_texture_2d_draw(
&(rodeo_rectangle_t){
.x = (float)rodeo_input_mouse_x_get() - (orc_size[0] / 2.0f),
@@ -140,6 +193,13 @@ main_loop(void)
" fps: %.2f ",
time_var
);
+
+ rodeo_debug_text_draw(
+ 2,
+ 4,
+ " orc count: %"PRIu32" ",
+ num_of_units
+ );
}
}
@@ -158,7 +218,7 @@ main(void)
rodeo_logLevel_error,
"Testing error log level... It seems to work!"
);
- mrodeo_window_do(480, 640, "Rodeo Window")
+ mrodeo_window_do(480, 640, rodeo_string_create("Rodeo Window"))
{
renderer = rodeo_renderer_name_get();
rodeo_frame_limit_set(60);