aboutsummaryrefslogtreecommitdiff
path: root/assets/src/main.c
blob: 188a7eee0eee975d9a8ad8a14e5d6e09f2f36dd7 (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;
		position.y += current_input.y;
	}
	
	set_active_shader(grayscale);
	draw_texture(femme, FROM_FIXED(position.x), FROM_FIXED(position.y));
	reset_active_shader();
}

void exit(void)
{
	
}