-
Notifications
You must be signed in to change notification settings - Fork 0
/
player.c
40 lines (28 loc) · 867 Bytes
/
player.c
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
34
35
36
37
38
#include "player.h"
#include "images/stage1.h"
#include "gba.h"
//file for movement logic of player
void moveUp(Player* p) {
int delta = 1;
colorIn(p->row, p->col, p->sideLength, stage1);
p->row -= delta;
drawRectDMA(p->row, p->col, p->sideLength, p->sideLength, RED);
}
void moveDown(Player* p) {
int delta = 1;
colorIn(p->row, p->col, p->sideLength, stage1);
p->row += delta;
drawRectDMA(p->row, p->col, p->sideLength, p->sideLength, RED);
}
void moveLeft(Player* p) {
int delta = 1;
colorIn(p->row, p->col, p->sideLength, stage1);
p->col -= delta;
drawRectDMA(p->row, p->col, p->sideLength, p->sideLength, RED);
}
void moveRight(Player* p) {
int delta = 1;
colorIn(p->row, p->col, p->sideLength, stage1);
p->col += delta;
drawRectDMA(p->row, p->col, p->sideLength, p->sideLength, RED);
}