Small Fixes
This commit is contained in:
parent
64f54d3397
commit
4a4f1ecb0e
5 changed files with 9 additions and 1 deletions
BIN
data/player.png
BIN
data/player.png
Binary file not shown.
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 4.4 KiB |
|
@ -141,6 +141,7 @@ void hurtEntity(Entity *e, int damage, int dir, u32 hurtColor, Entity *damager){
|
||||||
playSoundPositioned(snd_bossdeath, e->level, e->x, e->y);
|
playSoundPositioned(snd_bossdeath, e->level, e->x, e->y);
|
||||||
e->p.endTimer = 60;
|
e->p.endTimer = 60;
|
||||||
e->p.isDead = true;
|
e->p.isDead = true;
|
||||||
|
e->hurtTime = 10;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -96,15 +96,19 @@ void ingameMenuTick(PlayerData *pd, int menu) {
|
||||||
case MENU_WIN:
|
case MENU_WIN:
|
||||||
if (pd->inputs.k_accept.clicked){
|
if (pd->inputs.k_accept.clicked){
|
||||||
pd->ingameMenu = MENU_NONE;
|
pd->ingameMenu = MENU_NONE;
|
||||||
|
pd->entity.p.hasWon = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MENU_LOSE:
|
case MENU_LOSE:
|
||||||
if (pd->inputs.k_accept.clicked){
|
if (pd->inputs.k_accept.clicked){
|
||||||
pd->ingameMenu = MENU_NONE;
|
pd->ingameMenu = MENU_NONE;
|
||||||
|
pd->entity.p.isDead = false;
|
||||||
|
pd->entity.p.health = 10;
|
||||||
pd->entity.level = 1;
|
pd->entity.level = 1;
|
||||||
playerSpawn(pd);
|
playerSpawn(pd);
|
||||||
//TODO: This canceled to main menu, but what should I do in multiplayer?
|
//TODO: This canceled to main menu, but what should I do in multiplayer?
|
||||||
}
|
}
|
||||||
|
pd->entity.hurtTime = 10;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_CONTAINER:
|
case MENU_CONTAINER:
|
||||||
|
@ -186,6 +190,7 @@ void ingameMenuTick(PlayerData *pd, int menu) {
|
||||||
wrap = wrap - 1;
|
wrap = wrap - 1;
|
||||||
|
|
||||||
pd->entity.p.health = 10;
|
pd->entity.p.health = 10;
|
||||||
|
pd->entity.hurtTime = 10;
|
||||||
|
|
||||||
//head
|
//head
|
||||||
if(pd->ingameMenuSelection==0) {
|
if(pd->ingameMenuSelection==0) {
|
||||||
|
|
|
@ -352,6 +352,8 @@ bool playerUse(PlayerData *pd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void tickPlayer(PlayerData *pd, bool inmenu) {
|
void tickPlayer(PlayerData *pd, bool inmenu) {
|
||||||
|
if (pd->entity.p.isDead) return;
|
||||||
|
|
||||||
//invincibility time
|
//invincibility time
|
||||||
if (pd->entity.hurtTime > 0) pd->entity.hurtTime--;
|
if (pd->entity.hurtTime > 0) pd->entity.hurtTime--;
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#define PLAYER_SPRITE_EYES_COUNT 5
|
#define PLAYER_SPRITE_EYES_COUNT 5
|
||||||
#define PLAYER_SPRITE_BODY_COUNT 6
|
#define PLAYER_SPRITE_BODY_COUNT 6
|
||||||
#define PLAYER_SPRITE_ARMS_COUNT 6
|
#define PLAYER_SPRITE_ARMS_COUNT 6
|
||||||
#define PLAYER_SPRITE_LEGS_COUNT 4
|
#define PLAYER_SPRITE_LEGS_COUNT 5
|
||||||
|
|
||||||
|
|
||||||
typedef struct _plrsp {
|
typedef struct _plrsp {
|
||||||
|
|
Loading…
Add table
Reference in a new issue