X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fplayer.c;h=6c97e38dd2fad2338034c3cff83453c5e646b5c2;hb=79c636931d1f9bf844196e91be171b17bbe9c04f;hp=5a39077e9437248b2a9a3b5b2d6e83e3dfbff330;hpb=097d03fa2406fca819b27b698ffb1cfc8ac445c2;p=gbajam22 diff --git a/src/player.c b/src/player.c index 5a39077..6c97e38 100644 --- a/src/player.c +++ b/src/player.c @@ -1,4 +1,5 @@ #include +#include "game.h" #include "player.h" #include "level.h" #include "gbaregs.h" @@ -15,6 +16,17 @@ void init_player(struct player *p, struct level *lvl) void player_input(struct player *p, uint16_t bnstate) { +#ifndef BUILD_GBA + p->theta = (p->theta + view_dtheta) % X_2PI; + if(p->theta < 0) p->theta += X_2PI; + p->phi += view_dphi; + if(p->phi > X_HPI) p->phi = X_HPI; + if(p->phi < -X_HPI) p->phi = -X_HPI; + + view_dtheta = 0; + view_dphi = 0; +#endif + if(bnstate & KEY_UP) { p->phi += 0x800; if(p->phi > X_HPI) p->phi = X_HPI;