Skip to content

Commit

Permalink
Bug fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
mb88a committed Nov 11, 2022
1 parent b8c76dd commit 7743963
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ all:
$(CC) $(CFLAGS) $(FILES) -o bin/MathRace.js
cp img/favicon.ico bin/
cp src/MathRace.html bin/
cp src/run.sh bin/
chmod a+x bin/run.sh
run:
cd bin
python3 -m http.server 8000
cd ..
bin/run.sh
clean:
rm --force --recursive bin
rm --force --recursive img_conv
rm --force --recursive img_conv
6 changes: 6 additions & 0 deletions src/game.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,14 @@ void move(Player *player, Game *game, unsigned char *map) {
}else{
if(player->crashd){
player->direction++;
if(player->direction > 8){
player->direction = 1;
}
}else{
player->direction--;
if(player->direction < 1){
player->direction = 8;
}
}
player->crashc++;
if(player->crashc == player->crashlen){
Expand Down
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ int main(void) {
player.old_ctl = 0;
player.speed = 4;
player.iscalc = 0;
player.crashlen = 50;
player.crashlen = 24;
init_canvas(WIDTH, HEIGHT, "canvas");
init_getkey();
emscripten_set_main_loop(loop, 50, 1);
Expand Down
1 change: 1 addition & 0 deletions src/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python3 -m http.server 8000

0 comments on commit 7743963

Please sign in to comment.