Add shocked animation, add debug macro that sets Lukifer's artifacts

This commit is contained in:
blitzdoughnuts 2025-02-06 14:02:07 -05:00
parent 0821267905
commit 7c0e6f9afe
6 changed files with 40 additions and 6 deletions

Binary file not shown.

View file

@ -97,6 +97,7 @@ SDL2:
- Smooth out the level change from the changeroom trigger object (at least don't jar the camera back to default position)
- Add idle animations for Lukifer
- Make the object creation function optionally override existing, non-active objects
- Find a way to embed assets INTO THE GAME!
- Gesture ideas:
- Gesturing a stool will make Lukifer sit. Should he have a coat, he'll pull out a drink.

9
game.h
View file

@ -28,7 +28,7 @@ Made by blitzdoughnuts
#define INTER_LIMIT 32 // how many interactibles can be on a level at a time?
#define GAMETITLE "Wake to Hell"
#define VERSION_NUMBER "0.4.0"
#define VERSION_NUMBER "0.4.1"
#ifndef WTH_PRINT
#define WTH_PRINT(x...)
@ -492,6 +492,9 @@ void start() {
plr.animflimit = WTH_PLR_IDLE_LEN;
menu.menuselect = 0;
menu.menulimit = 2;
#ifdef WTH_ARTIFACTS
plr.artifacts = WTH_ARTIFACTS;
#endif
loadGame();
};
@ -756,7 +759,11 @@ void step() {
//case 1: options[0] ^= WTHOPTS_DEVCAM; break;
case 1: menu.menuindex = 1; menu.menuselect = 0; menu.menulimit = 3; break;
case 2: // exiting from pause menu to main menu; clear all gamevariables!
#ifdef WTH_ARTIFACTS
plr.artifacts = WTH_ARTIFACTS;
#else
plr.artifacts = 0;
#endif
plr.animframe = plr.animindex = plr.animtimer = 0;
plr.hsp = plr.vsp = plr.hsp_sub = plr.vsp_sub = 0;
level = 0;

View file

@ -179,6 +179,8 @@ void drawTextString(const char *stuff, int x, int y, uint8_t color) {
};
};
uint8_t found = 0;
uint8_t gesture = 0; // keeps track of added gesture objects
void signalMisc(uint8_t signal) {
switch (signal)
{
@ -194,7 +196,6 @@ void signalMisc(uint8_t signal) {
break;
#endif
case MISC_GESTURE:
uint8_t found = 0;
for (uint8_t i = 0; i < interacts_count; i++) {
if (interacts[i].objID == INTERTYPE_ARTIFACT && interacts[i].x - 30 <= plr.x && interacts[i].x + 30 >= plr.x) {
puts(gestures[3 + interacts[i].vars[0]]);
@ -214,7 +215,6 @@ void signalMisc(uint8_t signal) {
};
break;
case MISC_NEWROOM:
uint8_t gesture = 0; // keeps track of added gesture objects
switch (level)
{
case ROOM_HOUSE:
@ -380,7 +380,32 @@ void draw() {
}
};
drawSpriteSheeted(plrsprites[(plr.flags & FLAG_HASCOAT) ? plr.animindex : plr.animindex + WTH_PLR_SPRCOUNT], (plr.x - 75) - cam_x, (plr.y - 100) - cam_y, plr.animframe, 150, 150, (plr.flags & FLAG_FLIPPED) ? 1 : 0);
// draw player
uint8_t plrFrame = plr.animframe;
if (plr.animindex == WTH_PLR_SPOOKED_SPR) {
switch (plr.animframe)
{
case 2: case 3: // stall Lukifer's initial shock for 3 frames
plrFrame = 1;
break;
case 4: case 5: case 6: case 7: // cue turnaround
plrFrame -= 3;
break;
case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19: case 20: // line boil Lukifer turned around
plrFrame = 4 + (plr.animframe & 1);
break;
case 21: case 22: // Lukifer reacts in unamusement
plrFrame -= 16;
break;
case 23: case 24: case 25: case 26: case 27: case 28: // loop unamusement
plrFrame = 7;
break;
case 29: case 30: // go back to turning right
plrFrame -= 21;
break;
};
};
drawSpriteSheeted(plrsprites[(plr.flags & FLAG_HASCOAT) ? plr.animindex : plr.animindex + WTH_PLR_SPRCOUNT], (plr.x - 75) - cam_x, (plr.y - 100) - cam_y, plrFrame, 150, 150, (plr.flags & FLAG_FLIPPED) ? 1 : 0);
if (renderFlags & 1) drawSprite(sprites[WTH_SPR_UPARROW], plr.x - 20 - cam_x, plr.y - 150 - cam_y);
if (renderFlags & 2) drawSprite(sprites[WTH_SPR_UPARROW], plr.x - 20 - cam_x, plr.y + 25 - cam_y);
@ -752,7 +777,7 @@ int main(int argc, char *argv[]) {
plrsprites[WTH_PLR_UPSTAIR2_SPR] = IMG_LoadTexture(render, "sprites/plr_upstairs2.png");
plrsprites[WTH_PLR_DNSTAIR1_SPR] = IMG_LoadTexture(render, "sprites/plr_idle1.png");
plrsprites[WTH_PLR_DNSTAIR2_SPR] = IMG_LoadTexture(render, "sprites/plr_walk.png");
plrsprites[WTH_PLR_SPOOKED_SPR] = IMG_LoadTexture(render, "sprites/plr_walk.png");
plrsprites[WTH_PLR_SPOOKED_SPR] = IMG_LoadTexture(render, "sprites/plr_surprise.png");
// NO COAT
plrsprites[WTH_PLR_SPRCOUNT + WTH_PLR_IDLE_SPR] = IMG_LoadTexture(render, "sprites/plr_idle_coatless.png");
plrsprites[WTH_PLR_SPRCOUNT + WTH_PLR_WALK_SPR] = IMG_LoadTexture(render, "sprites/plr_walk_coatless.png");
@ -763,7 +788,7 @@ int main(int argc, char *argv[]) {
plrsprites[WTH_PLR_SPRCOUNT + WTH_PLR_UPSTAIR2_SPR] = IMG_LoadTexture(render, "sprites/plr_upstairs2.png");
plrsprites[WTH_PLR_SPRCOUNT + WTH_PLR_DNSTAIR1_SPR] = IMG_LoadTexture(render, "sprites/plr_idle1.png");
plrsprites[WTH_PLR_SPRCOUNT + WTH_PLR_DNSTAIR2_SPR] = IMG_LoadTexture(render, "sprites/plr_walk_coatless.png");
plrsprites[WTH_PLR_SPRCOUNT + WTH_PLR_SPOOKED_SPR] = IMG_LoadTexture(render, "sprites/plr_walk_coatless.png");
plrsprites[WTH_PLR_SPRCOUNT + WTH_PLR_SPOOKED_SPR] = IMG_LoadTexture(render, "sprites/plr_surprise.png");
sprites[WTH_SPR_MENU] = IMG_LoadTexture(render, "sprites/MENU.png");
sprites[WTH_SPR_FONTMAP] = IMG_LoadTexture(render, "sprites/fontmap.png");

View file

@ -33,6 +33,7 @@
//#define WTH_LOOPOBJS
#define WTH_DEBUG // Enable debugging options that show variables and other details
#define WTH_ARTIFACTS 0x0F // Set the artifacts Lukifer starts with. If not defined, defaults to 8
//#define WTH_NOOPTIONS // Disable the Options menu and use the DEFAULT_OPTIONS macro
//#define WTH_DEMOS // Enable demo recording on frontends that support it
//#define WTH_NOSOUND // Disable audio on frontends that use it

BIN
sprites/plr_surprise.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB