aboutsummaryrefslogtreecommitdiff
path: root/assets/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'assets/src/main.c')
-rw-r--r--assets/src/main.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/assets/src/main.c b/assets/src/main.c
index 68ab0f1..2a8ab80 100644
--- a/assets/src/main.c
+++ b/assets/src/main.c
@@ -2,6 +2,7 @@
static int femme = -1;
static int grayscale = -1;
+static vec2 position = (vec2){TO_FIXED(32), TO_FIXED(48)};
void init(void)
{
@@ -11,9 +12,18 @@ void init(void)
void update(void)
{
- draw_text("Femme my beloved!", 4, 4, 20, BLACK);
+ if(is_key_held(KEY_B)){
+ draw_text("Femme my beloved!", 4, 4, 20, BLACK);
+ }
+
+ vec2 current_input = get_dir_input();
+ if(current_input.x != 0 || current_input.y != 0){
+ position.x += current_input.x * 0.5f;
+ position.y += current_input.y * 0.5f;
+ }
+
set_active_shader(grayscale);
- draw_texture(femme, 32, 48);
+ draw_texture(femme, FROM_FIXED(position.x), FROM_FIXED(position.y));
reset_active_shader();
}