#include "player.h" #include "map.h" #include #define P_WIDTH 8 #define P_HEIGHT 8 #ifdef FXCG50 #define SPEED 3 #else #define SPEED 1 #endif extern Player MyPlayer; extern Map *map_level; extern bopti_image_t demo_player_img; void PlayerDraw(void) { dimage(MyPlayer.px-P_WIDTH/2, MyPlayer.py-P_HEIGHT/2, &demo_player_img); } void PlayerLeft(void) { if(MyPlayer.x >= SPEED){ MyPlayer.x-=SPEED; } } void PlayerRight(void) { if(MyPlayer.x <= map_level->w * T_WIDTH - SPEED){ MyPlayer.x+=SPEED; } } void PlayerUp(void) { if(MyPlayer.y >= SPEED){ MyPlayer.y-=SPEED; } } void PlayerDown(void) { if(MyPlayer.y <= map_level->h * T_HEIGHT - SPEED){ MyPlayer.y+=SPEED; } } void PlayerAction(void) { }