aboutsummaryrefslogtreecommitdiff
path: root/plugins/score/score.c
blob: 7ad8b66131abf95cb04529f2da9f073a5bd03fe9 (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
#include <stdio.h>
#include "../game/game.h"

static int score = 0;

void add_score(int s)
{
	score += s;
}

int get_score()
{
	return score;
}

static void render_score(struct winsize ws)
{
	(void) ws;

	printf("\e[32m\e[3mScore:\e[23m %d", score);
}

__attribute__ ((constructor)) static void init()
{
	register_render_component(&render_score);
}