blob: 2a8ab80c6ec951109ccb2128d7f4a092a097a310 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#include "gunner.h"
static int femme = -1;
static int grayscale = -1;
static vec2 position = (vec2){TO_FIXED(32), TO_FIXED(48)};
void init(void)
{
femme = load_new_tex("assets/femme.png");
grayscale = load_new_shader("assets/gs_full.glsl");
}
void update(void)
{
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, FROM_FIXED(position.x), FROM_FIXED(position.y));
reset_active_shader();
}
void exit(void)
{
}
|