diff options
| author | Uneven Prankster <unevenprankster@protonmail.com> | 2023-10-15 21:28:29 -0300 |
|---|---|---|
| committer | Uneven Prankster <unevenprankster@protonmail.com> | 2023-10-15 21:28:29 -0300 |
| commit | 1c0cc775732201f4c4d3ee0d6772be786b3b4aa1 (patch) | |
| tree | f5d692d046868261275c7430a624c3ea9ed75d3d /assets/src | |
| parent | a89f892640cf12f75c7ce18e6e88c70a8d3965ed (diff) | |
A lot has certainly happened!
Diffstat (limited to 'assets/src')
| -rw-r--r-- | assets/src/gunner.h | 18 | ||||
| -rw-r--r-- | assets/src/main.c | 14 |
2 files changed, 29 insertions, 3 deletions
diff --git a/assets/src/gunner.h b/assets/src/gunner.h index f99a5fd..be1b32e 100644 --- a/assets/src/gunner.h +++ b/assets/src/gunner.h @@ -186,6 +186,10 @@ void unload_active_shaders(void); void draw_text(const char* txt, int x, int y, int size, Color col); +i32 load_font(const char* path); + +void draw_text_font(i32 idx, const char* text, vec2 pos, fx32 size, Color col); + // Controller // b32 is_key_pressed(i32 btn); @@ -203,3 +207,17 @@ void stop_rumble(void); u32 rand_u32(void); int rand_range(i32 min, i32 max); + +// Audio // + +i32 load_audio(const char* path); + +void play_audio(i32 idx); + +void load_music(const char* path); + +void play_music(void); + +void set_music_loop(b32 loop); + +void set_music_loop_point(f32 point); diff --git a/assets/src/main.c b/assets/src/main.c index 188a7ee..0913641 100644 --- a/assets/src/main.c +++ b/assets/src/main.c @@ -2,19 +2,27 @@ static int femme = -1; static int grayscale = -1; +static int berry = -1; +static int night = -1; + static vec2 position = (vec2){TO_FIXED(32), TO_FIXED(48)}; +static vec2 text_pos = (vec2){TO_FIXED(64), TO_FIXED(16)}; void init(void) { femme = load_new_tex("assets/femme.png"); grayscale = load_new_shader("assets/gs_full.glsl"); + berry = load_font("assets/berry-rotunda.fnt"); + + load_music("assets/wicked_glee.ogg"); + set_music_loop_point(15.73f); + + play_music(); } void update(void) { - if(is_key_held(KEY_B)){ - draw_text("Femme my beloved!", 4, 4, 20, BLACK); - } + draw_text_font(berry, "Femme is a cute", text_pos, 24, BLACK); vec2 current_input = get_dir_input(); if(current_input.x != 0 || current_input.y != 0){ |
