Remove game builds, mods, and Debian packaging; they've been moved to

blitzstuff/PROJECTS/WTH_EXTRAS
This commit is contained in:
blitzdoughnuts 2025-01-11 14:50:18 -05:00
parent 71036ba87a
commit bd12cf1568
28 changed files with 1 additions and 971 deletions

1
.gitignore vendored
View file

@ -8,3 +8,4 @@ BUILD
*.bin
saf.h
IGNORE/*
ETC/*

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,12 +0,0 @@
This is a collection of patch mods for Wake to Hell, to be applied with git apply. These may not work with versions older than v0.2.0.
NOTE: These mods may not work with the latest version of Wake to Hell as it's in development. Refer to the mod READMEs for more details.
Here's some info on the mods:
- touchscreen.diff:
Adds touchscreen support for advanced frontends. On PC, it emulates taps with mouse clicks.
- cheats.diff:
Adds "cheats" to the game. Press F4 to open a cheat menu that lets you change maps, change the player's speed, and manipulate objects. Only on SDL2.
- minimal.diff:
Removes useless objects from the game, e.g. unimportant decorations. Hopefully should help performance.
- ff/ff.diff:
Family friendly mod (previously Censor Mode), separated from base game for being not very LRS. Removes generally questionable or obscene content.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 839 B

View file

@ -1,9 +0,0 @@
This is the Family Friendly mod for Wake to Hell. Previously, it was part of the base game, but was removed for being too retarded of a feature for an LRS game.
The changes made are as follows:
- Text strings are altered (game name is Wake to Chaos, any swearing or vulgarity is replaced)
- Assets are replaced with ones less violent or sultry (blood is gone, Hamie's book has a less provocative beach photo)
That's literally it.
To apply, run the .sh file from the source code's base directory.

View file

@ -1,13 +0,0 @@
#!/bin/sh
# Family Friendly / "Censor Mode" mod for Wake to Hell
# This used to be a proper game feature, but was taken
# out for less retarded reasons. This mod will recreate
# the effects of Censor Mode.
# get the mod directory from $0, assuming this file is in there
MODDIR=$(dirname $0)
cp $MODDIR/sprites .
cat game.h | sed "s/#define WINTITLE \"Wake to Hell\"/#define WINTITLE \"Wake to Chaos\"/" > game.h

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

View file

@ -1 +0,0 @@
NOTE: This mod is made on Wake to Hell v0.1.6! Get the source code to that version (maybe find it through commits) before patching!

View file

@ -1,684 +0,0 @@
diff --git a/game.h b/game.h
index eb95b7b..fd8662f 100755
--- a/game.h
+++ b/game.h
@@ -130,6 +130,7 @@ typedef struct {
uint16_t idleanimtimer;
uint8_t state;
uint8_t animframe, animtimer, animflimit, animindex;
+ uint8_t input_keys, input_prevkeys;
} WTH_Player;
typedef struct {
@@ -151,7 +152,7 @@ typedef struct {
uint8_t objID, flags;
} WTH_Interactible;
-WTH_Player plr; // the one and only... uh... unstable furry man.
+WTH_Player plr[2]; // the one and only... uh... unstable furry men.
WTH_Camera cam; // and also the cameraman
WTH_Interactible interacts[INTER_LIMIT];
uint8_t interacts_count = 0; // convenient counter for all present interactibles
@@ -179,7 +180,7 @@ uint8_t addObject(int nx, int ny, uint8_t objType) {
return 0;
};
uint8_t index = interacts_count;
- if (objType == INTERTYPE_ARTIFACT && (plr.artifacts & (1 << interacts[index].vars[0]))) return 0; // is it an artifact the player already has? don't bother existing
+ if (objType == INTERTYPE_ARTIFACT && (plr[0].artifacts & (1 << interacts[index].vars[0]))) return 0; // is it an artifact the player already has? don't bother existing
for (uint8_t i = 0; i < 7; i++) {
interacts[index].vars[i] = 0;
};
@@ -192,7 +193,7 @@ uint8_t addObject(int nx, int ny, uint8_t objType) {
switch (objType)
{
case INTERTYPE_DOOR:
- if (plr.x >= interacts[index].x - 40 && plr.x < interacts[index].x + 40) interacts[index].flags ^= 1 << 2;
+ if (plr[0].x >= interacts[index].x - 40 && plr[0].x < interacts[index].x + 40) interacts[index].flags ^= 1 << 2;
break;
case 255:
interacts[index].vars[2] = WTH_PLR_IDLE_LEN;
@@ -247,7 +248,7 @@ static inline void LoadInRoom() {
addObject(-100, 0, INTERTYPE_MOVEBLOCK);
break;
case 3: // endless streets
- addObject(plr.x, 0, INTERTYPE_MOVETRACK);
+ addObject(plr[0].x, 0, INTERTYPE_MOVETRACK);
interacts[0].vars[1] = 4;
addObject(1200, GROUNDLEVEL, INTERTYPE_DOOR);
interacts[1].vars[0] = 11;
@@ -256,7 +257,7 @@ static inline void LoadInRoom() {
interacts[ addObject(270, 0, INTERTYPE_DOOR) ].vars[0] = 5;
break;
case 5: // hospital main lobby (badge artifact)
- if (plr.artifacts >= 15) interacts[ addObject(-20, 0, INTERTYPE_DOOR) ].vars[0] = 10;
+ if (plr[0].artifacts >= 15) interacts[ addObject(-20, 0, INTERTYPE_DOOR) ].vars[0] = 10;
break;
case 6:
addObject(0, 0, INTERTYPE_MOVEBLOCK);
@@ -283,13 +284,15 @@ static inline void LoadInRoom() {
static inline void changeRoom(uint8_t input, uint8_t startAtInter) {
level = input;
- plr.x = cam.x = 50;
- plr.y = GROUNDLEVEL;
+ plr[0].x = plr[1].x = cam.x = 50;
+ plr[0].y = plr[1].y = GROUNDLEVEL;
cam.y = 0;
- plr.hsp = plr.vsp = plr.hsp_sub = plr.vsp_sub = 0;
- if (plr.flags & FLAG_CANTMOVE) plr.flags ^= FLAG_CANTMOVE;
- if (startAtInter > 0) {
- plr.x = interacts[startAtInter - 1].x;
+ for (uint8_t i = 0; i < 2; i++) {
+ plr[i].hsp = plr[i].vsp = plr[i].hsp_sub = plr[i].vsp_sub = 0;
+ if (plr[i].flags & FLAG_CANTMOVE) plr[i].flags ^= FLAG_CANTMOVE;
+ if (startAtInter > 0) {
+ plr[i].x = interacts[startAtInter - 1].x;
+ };
};
LoadInRoom();
};
@@ -298,8 +301,8 @@ void interact_step(WTH_Interactible *REF) {
if (!(REF->flags & INTER_ACTIVE)) return;
switch (REF->objID) {
case INTERTYPE_TRIGGER:
- if ((REF->flags & FLAG_HASCOAT) && !(plr.flags & FLAG_HASCOAT)) break; // coat-only trigger
- if (plr.x >= REF->x) {
+ if ((REF->flags & FLAG_HASCOAT) && !(plr[0].flags & FLAG_HASCOAT)) break; // coat-only trigger
+ if (plr[0].x >= REF->x) {
changeRoom(REF->vars[0], 0);
};
break;
@@ -309,37 +312,37 @@ void interact_step(WTH_Interactible *REF) {
(flag 2 is only really used if
transitioning rooms) */
if (!(REF->flags & 1 << 1)) {
- if (!(plr.flags & FLAG_GROUNDED)) return;
- if (plr.x >= REF->x - 40 && plr.x < REF->x + 40) {
+ if (!(plr[0].flags & FLAG_GROUNDED)) return;
+ if (plr[0].x >= REF->x - 40 && plr[0].x < REF->x + 40) {
// printf("Player can enter door");
signalDraw(DRAW_PLRUPARROW);
- if ((input_keys & KEY_UP)) {
+ if ((plr[0].input_keys & KEY_UP)) {
signalPlaySFX(4);
- plr.flags ^= FLAG_CANTMOVE | FLAG_HALTANIM;
- plr.animindex = WTH_PLR_DOOR_SPR;
- plr.animframe = plr.animtimer = 0;
- plr.animflimit = WTH_PLR_DOOR_LEN;
- plr.hsp = plr.vsp = 0;
+ plr[0].flags ^= FLAG_CANTMOVE | FLAG_HALTANIM;
+ plr[0].animindex = WTH_PLR_DOOR_SPR;
+ plr[0].animframe = plr[0].animtimer = 0;
+ plr[0].animflimit = WTH_PLR_DOOR_LEN;
+ plr[0].hsp = plr[0].vsp = 0;
REF->vars[1] = 40;
REF->flags ^= 1 << 1;
signalDraw(DRAW_FADEOUT);
};
- if ((REF->flags & 1 << 2) && plr.hsp) {
+ if ((REF->flags & 1 << 2) && plr[0].hsp) {
signalPlaySFX(5);
REF->flags ^= 1 << 2;
};
}
} else {
if (REF->vars[1] == 0) {
- plr.flags ^= FLAG_HALTANIM;
- plr.animindex = 0;
- plr.animflimit = WTH_PLR_IDLE_LEN;
+ plr[0].flags ^= FLAG_HALTANIM;
+ plr[0].animindex = 0;
+ plr[0].animflimit = WTH_PLR_IDLE_LEN;
changeRoom(REF->vars[0], REF->vars[2]);
signalDraw(DRAW_FADEIN);
fadespeed = 3;
} else {
- if (plr.x - 1 < REF->x) plr.x++;
- if (plr.x + 1 > REF->x) plr.x--;
+ if (plr[0].x - 1 < REF->x) plr[0].x++;
+ if (plr[0].x + 1 > REF->x) plr[0].x--;
REF->vars[1]--;
fadespeed++;
};
@@ -347,17 +350,17 @@ void interact_step(WTH_Interactible *REF) {
break;
case INTERTYPE_BOOK:
if (!(REF->flags & 1 << 4)) {
- if (!(plr.flags & FLAG_GROUNDED)) return;
- if (plr.x >= REF->x - 40 && plr.x < REF->x + 40) {
+ if (!(plr[0].flags & FLAG_GROUNDED)) return;
+ if (plr[0].x >= REF->x - 40 && plr[0].x < REF->x + 40) {
// printf("Player can enter door");
signalDraw(DRAW_PLRUPARROW);
if ((input_keys & KEY_UP)) {
signalPlaySFX(10);
- plr.flags ^= FLAG_CANTMOVE | FLAG_HALTANIM;
- plr.animindex = 2;
- plr.animframe = plr.animtimer = 0;
- plr.animflimit = WTH_PLR_DOOR_LEN;
- plr.hsp = plr.vsp = 0;
+ plr[0].flags ^= FLAG_CANTMOVE | FLAG_HALTANIM;
+ plr[0].animindex = 2;
+ plr[0].animframe = plr[0].animtimer = 0;
+ plr[0].animflimit = WTH_PLR_DOOR_LEN;
+ plr[0].hsp = plr[0].vsp = 0;
REF->vars[1] = 40;
REF->flags ^= 1 << 4;
signalDraw(DRAW_FADEOUT);
@@ -365,58 +368,58 @@ void interact_step(WTH_Interactible *REF) {
}
} else {
if (REF->vars[1] == 0) {
- plr.flags ^= FLAG_HALTANIM;
- plr.animindex = 0;
- plr.animflimit = WTH_PLR_IDLE_LEN;
+ plr[0].flags ^= FLAG_HALTANIM;
+ plr[0].animindex = 0;
+ plr[0].animflimit = WTH_PLR_IDLE_LEN;
GAME_STATE = 4;
signalDraw(DRAW_FADEIN);
fadespeed = 3;
REF->vars[1] = 255;
REF->flags ^= 1 << 4;
} else {
- if (plr.x - 1 < REF->x) plr.x++;
- if (plr.x + 1 > REF->x) plr.x--;
+ if (plr[0].x - 1 < REF->x) plr[0].x++;
+ if (plr[0].x + 1 > REF->x) plr[0].x--;
REF->vars[1]--;
fadespeed++;
};
};
break;
case INTERTYPE_COAT:
- if (plr.x >= REF->x - 40 && plr.x < REF->x + 40) {
+ if (plr[0].x >= REF->x - 40 && plr[0].x < REF->x + 40) {
// printf("Player can enter door");
signalDraw(DRAW_PLRUPARROW);
if (WTH_keyPressed(KEY_UP)) {
- plr.flags ^= FLAG_HASCOAT;
+ plr[0].flags ^= FLAG_HASCOAT;
signalPlaySFX(3);
};
};
break;
case INTERTYPE_ARTIFACT:
- if (plr.x >= REF->x - 30 && plr.x < REF->x + 30) {
+ if (plr[0].x >= REF->x - 30 && plr[0].x < REF->x + 30) {
signalDraw(DRAW_PLRUPARROW);
if (WTH_keyPressed(KEY_UP)) {
REF->flags ^= INTER_ACTIVE; // disable it
- plr.artifacts ^= 1 << REF->vars[0];
+ plr[0].artifacts ^= 1 << REF->vars[0];
signalPlaySFX(6 + REF->vars[0]);
};
};
break;
case INTERTYPE_MOVETRACK:
/* imagine that the X of the INSTANCE is like a last-frame
- X of the player, while the current plr.x is the current
+ X of the player, while the current plr[0].x is the current
frame X; we compare those and change the distance variable accordingly */
- if (REF->x != plr.x) {
- REF->vars[0] += (REF->x < plr.x) ? plr.x - REF->x : REF->x - plr.x;
+ if (REF->x != plr[0].x) {
+ REF->vars[0] += (REF->x < plr[0].x) ? plr[0].x - REF->x : REF->x - plr[0].x;
};
if (REF->vars[0] > 2500) {
level = REF->vars[1];
LoadInRoom();
- while (plr.x > 0) {
- plr.x -= 600;
+ while (plr[0].x > 0) {
+ plr[0].x -= 600;
cam.x -= 600;
}
};
- REF->x = plr.x;
+ REF->x = plr[0].x;
break;
case INTERTYPE_YOU:
// 0 = animtimer, 1 = animframe, 2 = animflimit
@@ -433,9 +436,9 @@ void interact_step(WTH_Interactible *REF) {
far to the left, or too far to the right
flag 1 blocks moving right; by default, it
only blocks moving left */
- if (plr.x < REF->x && !(REF->flags & 1) || (REF->flags & 1) && plr.x > REF->x) {
- plr.x = REF->x;
- plr.hsp = plr.hsp_sub = 0;
+ if (plr[0].x < REF->x && !(REF->flags & 1) || (REF->flags & 1) && plr[0].x > REF->x) {
+ plr[0].x = REF->x;
+ plr[0].hsp = plr[0].hsp_sub = 0;
};
break;
}
@@ -454,14 +457,20 @@ void manageOptions() {
#endif
void start() {
- plr.x = 50;
- plr.y = GROUNDLEVEL;
- plr.state = 1;
- //plr.flags = 0;
+ plr[0].x = 50;
+ plr[0].y = GROUNDLEVEL;
+ plr[0].state = 1;
+ plr[0].flags = 0;
+ plr[1].x = 5;
+ plr[1].y = GROUNDLEVEL;
+ plr[1].state = 1;
+ plr[1].flags = 0;
+ //plr[0].flags = 0;
cam.x = cam.y = 0;
GAME_STATE = 0;
GAME_FLAGS = 0;
- plr.animflimit = WTH_PLR_IDLE_LEN;
+ plr[0].animflimit = WTH_PLR_IDLE_LEN;
+ plr[1].animflimit = WTH_PLR_IDLE_LEN;
menu.menuselect = 0;
menu.menulimit = 2;
loadGame();
@@ -518,104 +527,142 @@ void step() {
else
fade += fadespeed;
};
- switch (plr.state)
+ for (uint8_t i = 0; i < 2; i++) {
+ switch (plr[i].state)
{
case PSTATE_NORMAL:
- if (!(plr.flags & FLAG_CANTMOVE)) {
- if ((input_keys & KEY_LEFT) && plr.hsp > -3) {
- plr.hsp_sub -= SUBPIXELUNIT_ACCURACY >> 3;
- plr.animindex = WTH_PLR_WALK_SPR;
- plr.animflimit = WTH_PLR_WALK_LEN;
- if (plr.flags & FLAG_HALTANIM) plr.flags ^= FLAG_HALTANIM;
- if (plr.hsp > 0) plr.hsp = 0;
- if (!(plr.flags & FLAG_FLIPPED)) plr.flags ^= FLAG_FLIPPED;
+ if (!(plr[i].flags & FLAG_CANTMOVE)) {
+ if ((plr[i].input_keys & KEY_LEFT) && plr[i].hsp > -3) {
+ plr[i].hsp_sub -= SUBPIXELUNIT_ACCURACY >> 3;
+ plr[i].animindex = WTH_PLR_WALK_SPR;
+ plr[i].animflimit = WTH_PLR_WALK_LEN;
+ if (plr[i].flags & FLAG_HALTANIM) plr[i].flags ^= FLAG_HALTANIM;
+ if (plr[i].hsp > 0) plr[i].hsp = 0;
+ if (!(plr[i].flags & FLAG_FLIPPED)) plr[i].flags ^= FLAG_FLIPPED;
};
- if ((input_keys & KEY_RIGHT) && plr.hsp < 3) {
- plr.hsp_sub += SUBPIXELUNIT_ACCURACY >> 3;
- plr.animindex = WTH_PLR_WALK_SPR;
- plr.animflimit = WTH_PLR_WALK_LEN;
- if (plr.flags & FLAG_HALTANIM) plr.flags ^= FLAG_HALTANIM;
- if (plr.hsp < 0) plr.hsp = 0;
- if (plr.flags & FLAG_FLIPPED) plr.flags ^= FLAG_FLIPPED;
+ if ((plr[i].input_keys & KEY_RIGHT) && plr[i].hsp < 3) {
+ plr[i].hsp_sub += SUBPIXELUNIT_ACCURACY >> 3;
+ plr[i].animindex = WTH_PLR_WALK_SPR;
+ plr[i].animflimit = WTH_PLR_WALK_LEN;
+ if (plr[i].flags & FLAG_HALTANIM) plr[i].flags ^= FLAG_HALTANIM;
+ if (plr[i].hsp < 0) plr[i].hsp = 0;
+ if (plr[i].flags & FLAG_FLIPPED) plr[i].flags ^= FLAG_FLIPPED;
};
- if (!(input_keys & KEY_LEFT) && !(input_keys & KEY_RIGHT) && (plr.flags & FLAG_GROUNDED)) { // seems erroneous
- plr.hsp = 0;
- if (plr.animindex != WTH_PLR_IDLE_SPR && plr.animindex != WTH_PLR_IDLE1_SPR) {
- plr.animindex = WTH_PLR_IDLE_SPR;
- plr.animflimit = WTH_PLR_IDLE_LEN;
- if (plr.flags & FLAG_HALTANIM) plr.flags ^= FLAG_HALTANIM;
+ if (!(plr[i].input_keys & KEY_LEFT) && !(plr[i].input_keys & KEY_RIGHT) && (plr[i].flags & FLAG_GROUNDED)) { // seems erroneous
+ plr[i].hsp = 0;
+ if (plr[i].animindex != WTH_PLR_IDLE_SPR && plr[i].animindex != WTH_PLR_IDLE1_SPR) {
+ plr[i].animindex = WTH_PLR_IDLE_SPR;
+ plr[i].animflimit = WTH_PLR_IDLE_LEN;
+ if (plr[i].flags & FLAG_HALTANIM) plr[i].flags ^= FLAG_HALTANIM;
};
- plr.idleanimtimer++;
- if (plr.idleanimtimer >= 400) {
- plr.animindex = WTH_PLR_IDLE1_SPR;
- plr.animflimit = WTH_PLR_IDLE1_LEN;
- if (!(plr.flags & FLAG_HALTANIM)) plr.flags ^= FLAG_HALTANIM;
- plr.animtimer = 0;
- plr.animframe = 0;
- plr.idleanimtimer = 0;
+ plr[i].idleanimtimer++;
+ if (plr[i].idleanimtimer >= 400) {
+ plr[i].animindex = WTH_PLR_IDLE1_SPR;
+ plr[i].animflimit = WTH_PLR_IDLE1_LEN;
+ if (!(plr[i].flags & FLAG_HALTANIM)) plr[i].flags ^= FLAG_HALTANIM;
+ plr[i].animtimer = 0;
+ plr[i].animframe = 0;
+ plr[i].idleanimtimer = 0;
};
};
};
- if (!(plr.flags & FLAG_NOPHYS)) {
- if (!(plr.flags & FLAG_GROUNDED)) {
- plr.vsp_sub += PRE_GRAVITY;
+ if (!(plr[i].flags & FLAG_NOPHYS)) {
+ if (!(plr[i].flags & FLAG_GROUNDED)) {
+ plr[i].vsp_sub += PRE_GRAVITY;
}
- if (plr.y > GROUNDLEVEL || plr.y + plr.vsp > GROUNDLEVEL) {
- if (!(plr.flags & FLAG_GROUNDED)) {
- plr.flags |= FLAG_GROUNDED;
+ if (plr[i].y > GROUNDLEVEL || plr[i].y + plr[i].vsp > GROUNDLEVEL) {
+ if (!(plr[i].flags & FLAG_GROUNDED)) {
+ plr[i].flags |= FLAG_GROUNDED;
};
- plr.vsp = 0;
- plr.vsp_sub = 0;
- plr.y = GROUNDLEVEL;
+ plr[i].vsp = 0;
+ plr[i].vsp_sub = 0;
+ plr[i].y = GROUNDLEVEL;
};
// if the calc messes up at long distances, try changing it to an int
- if (plr.vsp_sub > SUBPIXELUNIT_ACCURACY) {
- int16_t calc = (plr.vsp_sub / SUBPIXELUNIT_ACCURACY);
- plr.vsp += calc;
- plr.vsp_sub -= SUBPIXELUNIT_ACCURACY * calc;
+ if (plr[i].vsp_sub > SUBPIXELUNIT_ACCURACY) {
+ int16_t calc = (plr[i].vsp_sub / SUBPIXELUNIT_ACCURACY);
+ plr[i].vsp += calc;
+ plr[i].vsp_sub -= SUBPIXELUNIT_ACCURACY * calc;
};
- if (plr.vsp_sub < 0) {
- int16_t calc = (plr.vsp_sub / SUBPIXELUNIT_ACCURACY);
- plr.vsp -= calc;
- plr.vsp_sub += SUBPIXELUNIT_ACCURACY * calc;
+ if (plr[i].vsp_sub < 0) {
+ int16_t calc = (plr[i].vsp_sub / SUBPIXELUNIT_ACCURACY);
+ plr[i].vsp -= calc;
+ plr[i].vsp_sub += SUBPIXELUNIT_ACCURACY * calc;
};
- if (plr.hsp_sub > SUBPIXELUNIT_ACCURACY) {
- int16_t calc = (plr.hsp_sub / SUBPIXELUNIT_ACCURACY);
- plr.hsp += calc;
- plr.hsp_sub -= SUBPIXELUNIT_ACCURACY * calc;
+ if (plr[i].hsp_sub > SUBPIXELUNIT_ACCURACY) {
+ int16_t calc = (plr[i].hsp_sub / SUBPIXELUNIT_ACCURACY);
+ plr[i].hsp += calc;
+ plr[i].hsp_sub -= SUBPIXELUNIT_ACCURACY * calc;
};
- if (plr.hsp_sub < 0) {
- int16_t calc = (plr.hsp_sub / SUBPIXELUNIT_ACCURACY);
- plr.hsp += calc;
- plr.hsp_sub -= SUBPIXELUNIT_ACCURACY * calc; // HOW does this make ANY logical sense to work properly
+ if (plr[i].hsp_sub < 0) {
+ int16_t calc = (plr[i].hsp_sub / SUBPIXELUNIT_ACCURACY);
+ plr[i].hsp += calc;
+ plr[i].hsp_sub -= SUBPIXELUNIT_ACCURACY * calc; // HOW does this make ANY logical sense to work properly
};
- plr.x += plr.hsp;
- plr.y += plr.vsp;
+ plr[i].x += plr[i].hsp;
+ plr[i].y += plr[i].vsp;
};
break;
case PSTATE_SLEEPING: default:
- plr.animindex = WTH_PLR_SLEEP_SPR;
- plr.animflimit = WTH_PLR_SLEEP_LEN;
- if (input_keys & KEY_GESTURE && !(input_prevkeys & KEY_GESTURE)) {
- plr.state = PSTATE_NORMAL;
- plr.animindex = WTH_PLR_WALK_SPR;
- plr.vsp = -3;
- plr.vsp_sub = 0;
+ plr[i].animindex = WTH_PLR_SLEEP_SPR;
+ plr[i].animflimit = WTH_PLR_SLEEP_LEN;
+ if (plr[i].input_keys & KEY_GESTURE && !(plr[i].input_prevkeys & KEY_GESTURE)) {
+ plr[i].state = PSTATE_NORMAL;
+ plr[i].animindex = WTH_PLR_WALK_SPR;
+ plr[i].vsp = -3;
+ plr[i].vsp_sub = 0;
signalPlaySFX(1);
- plr.flags = 0;
+ plr[i].flags = 0;
};
break;
- }
+
+ plr[i].animtimer++;
+ printf("PLAYER %i ANIMTIMER %i\n", i, plr[i].animtimer);
+ if (plr[i].animtimer >= ANIM_SPEED && !( (plr[i].flags & FLAG_HALTANIM) && plr[i].animframe == plr[i].animflimit) ) {
+ plr[i].animframe += (plr[i].flags & FLAG_REVERSEANIM) ? -1 : 1;
+ plr[i].animtimer = 0;
+ };
+ if (!(plr[i].flags & FLAG_HALTANIM)) {
+ if (plr[i].animframe > plr[i].animflimit) plr[i].animframe = 0;
+ if (plr[i].animframe < 0) plr[i].animframe = plr[i].animflimit;
+ };
+ if (plr[i].flags & FLAG_GROUNDED) {
+ if (plr[i].animframe == 1 && plr[i].animflimit == WTH_PLR_WALK_LEN && !(plr[i].flags & FLAG_STEPDEBOUNCE)) {
+ signalPlaySFX(0);
+ plr[i].flags += FLAG_STEPDEBOUNCE;
+ } else if (plr[i].animframe != 1 && (plr[i].flags & FLAG_STEPDEBOUNCE)) plr[i].flags -= FLAG_STEPDEBOUNCE;
+ };
+ };
+ plr[i].animtimer++;
+ printf("PLAYER %i ANIMTIMER %i\n", i, plr[i].animtimer);
+ if (plr[i].animtimer >= ANIM_SPEED && !( (plr[i].flags & FLAG_HALTANIM) && plr[i].animframe == plr[i].animflimit) ) {
+ plr[i].animframe += (plr[i].flags & FLAG_REVERSEANIM) ? -1 : 1;
+ plr[i].animtimer = 0;
+ };
+ if (!(plr[i].flags & FLAG_HALTANIM)) {
+ if (plr[i].animframe > plr[i].animflimit) plr[i].animframe = 0;
+ if (plr[i].animframe < 0) plr[i].animframe = plr[i].animflimit;
+ };
+ if (plr[i].flags & FLAG_GROUNDED) {
+ if (plr[i].animframe == 1 && plr[i].animflimit == WTH_PLR_WALK_LEN && !(plr[i].flags & FLAG_STEPDEBOUNCE)) {
+ signalPlaySFX(0);
+ plr[i].flags += FLAG_STEPDEBOUNCE;
+ } else if (plr[i].animframe != 1 && (plr[i].flags & FLAG_STEPDEBOUNCE)) plr[i].flags -= FLAG_STEPDEBOUNCE;
+ };
+
+ };
if (!(options[0] & WTHOPTS_DEVCAM)) {
- if (plr.x > cam.x + (WIDTH - CAM_BOUNDS)) {
- cam.x += plr.x - (cam.x + (WIDTH - CAM_BOUNDS));
+ #define CAMPOS plr[0].x - (plr[0].x - plr[1].x) / 2
+ if (CAMPOS > cam.x + (WIDTH - CAM_BOUNDS)) {
+ cam.x += CAMPOS - (cam.x + (WIDTH - CAM_BOUNDS));
};
- if (plr.x < cam.x + CAM_BOUNDS) {
- cam.x -= (cam.x + CAM_BOUNDS) - plr.x;
+ if (CAMPOS < cam.x + CAM_BOUNDS) {
+ cam.x -= (cam.x + CAM_BOUNDS) - CAMPOS;
};
+ #undef CAMPOS
} else {
uint8_t speed = (xtrakeys & KEY_ATTACK) ? 6 : 3;
if (xtrakeys & KEY_RIGHT) cam.x += speed;
@@ -624,21 +671,6 @@ void step() {
if (xtrakeys & KEY_DOWN) cam.y += speed;
};
- plr.animtimer++;
- if (plr.animtimer >= ANIM_SPEED && !( (plr.flags & FLAG_HALTANIM) && plr.animframe == plr.animflimit) ) {
- plr.animframe += (plr.flags & FLAG_REVERSEANIM) ? -1 : 1;
- plr.animtimer = 0;
- };
- if (!(plr.flags & FLAG_HALTANIM)) {
- if (plr.animframe > plr.animflimit) plr.animframe = 0;
- if (plr.animframe < 0) plr.animframe = plr.animflimit;
- }
- if (plr.flags & FLAG_GROUNDED) {
- if (plr.animframe == 1 && plr.animflimit == WTH_PLR_WALK_LEN && !(plr.flags & FLAG_STEPDEBOUNCE)) {
- signalPlaySFX(0);
- plr.flags += FLAG_STEPDEBOUNCE;
- } else if (plr.animframe != 1 && (plr.flags & FLAG_STEPDEBOUNCE)) plr.flags -= FLAG_STEPDEBOUNCE;
- };
if (WTH_keyPressed(KEY_MENU)) {
GAME_STATE = 3;
@@ -670,12 +702,14 @@ void step() {
//case 1: options[0] ^= WTHOPTS_DEVCAM; break;
case 1: menu.menuindex = 1; menu.menuselect = 0; break;
case 2: // exiting from pause menu to main menu; clear all gamevariables!
- plr.artifacts = 0;
- plr.animframe = plr.animindex = plr.animtimer = 0;
- plr.hsp = plr.vsp = plr.hsp_sub = plr.vsp_sub = 0;
+ plr[0].artifacts = 0;
+ for (uint8_t i = 0; i < 2; i++) {
+ plr[i].animframe = plr[i].animindex = plr[i].animtimer = 0;
+ plr[i].hsp = plr[i].vsp = plr[i].hsp_sub = plr[i].vsp_sub = 0;
+ plr[i].flags = 0; // if this causes issues, move it to start()
+ };
level = 0;
signalMisc(MISC_STOPMUSIC);
- plr.flags = 0; // if this causes issues, move it to start()
start();
break;
}
@@ -707,13 +741,18 @@ void step() {
GAME_STATE = 1;
fademode = 1;
fadespeed = 3;
- if (plr.flags & FLAG_CANTMOVE) plr.flags ^= FLAG_CANTMOVE;
+ if (plr[0].flags & FLAG_CANTMOVE) plr[0].flags ^= FLAG_CANTMOVE;
+ if (plr[1].flags & FLAG_CANTMOVE) plr[1].flags ^= FLAG_CANTMOVE;
signalPlaySFX(11);
};
break;
}
input_prevkeys = input_keys;
+ plr[0].input_prevkeys = plr[0].input_keys;
+ plr[1].input_prevkeys = plr[1].input_keys;
input_keys = 0;
+ plr[0].input_keys = 0;
+ plr[1].input_keys = 0;
if (options[0] & WTHOPTS_DEVCAM) xtrakeys = 0;
};
diff --git a/main_sdl.c b/main_sdl.c
index 1b60e69..92908ca 100755
--- a/main_sdl.c
+++ b/main_sdl.c
@@ -49,6 +49,7 @@ Mix_Chunk *sfx[12];
SDL_Texture *wintext;
SDL_Texture *plrsprites[10];
+SDL_Texture *plr2sprites[10];
SDL_Texture *sprites[20];
SDL_Rect dspdest_rect; // this is the DESTINATION, aka screen position
@@ -226,7 +227,7 @@ void signalDraw(uint8_t index) {
};
break;
case DRAW_PLRUPARROW:
- drawSprite(sprites[WTH_SPR_UPARROW], plr.x - 20 - cam.x, plr.y - 150 - cam.y);
+ drawSprite(sprites[WTH_SPR_UPARROW], plr[0].x - 20 - cam.x, plr[0].y - 150 - cam.y);
break;
case DRAW_CHECK2XSIZE:
puts("signaled DRAW_CHECK2XSIZE");
@@ -313,10 +314,10 @@ void draw() {
switch (interacts[i].objID)
{
case 255:
- drawSpriteSheeted(sprites[WTH_SPR_YOU], (interacts[i].x - 75) - cam.x, (interacts[i].y - 100) - cam.y, interacts[i].vars[1], 150, 150, (plr.x < interacts[i].x) ? 1 : 0);
+ drawSpriteSheeted(sprites[WTH_SPR_YOU], (interacts[i].x - 75) - cam.x, (interacts[i].y - 100) - cam.y, interacts[i].vars[1], 150, 150, (plr[0].x < interacts[i].x) ? 1 : 0);
break;
case INTERTYPE_COAT:
- drawSpriteSheeted(sprites[WTH_SPR_COATRACK], interacts[i].x - 35 - cam.x, (interacts[i].y - 100) - cam.y, (plr.flags & FLAG_HASCOAT) ? 1 : 0, 70, 100, 0);
+ drawSpriteSheeted(sprites[WTH_SPR_COATRACK], interacts[i].x - 35 - cam.x, (interacts[i].y - 100) - cam.y, ((plr[0].flags & FLAG_HASCOAT) && (plr[1].flags & FLAG_HASCOAT)) ? 1 : 0, 70, 100, 0);
break;
case INTERTYPE_DECOR:
drawSprite(sprites[interacts[i].vars[0]], interacts[i].x - cam.x, interacts[i].y - cam.y);
@@ -329,8 +330,9 @@ void draw() {
break;
}
};
-
- drawSpriteSheeted(plrsprites[(plr.flags & FLAG_HASCOAT) ? plr.animindex : plr.animindex + 5], (plr.x - 75) - cam.x, (plr.y - 100) - cam.y, plr.animframe, 150, 150, (plr.flags & FLAG_FLIPPED) ? 1 : 0);
+
+ drawSpriteSheeted(plrsprites[(plr[0].flags & FLAG_HASCOAT) ? plr[0].animindex : plr[0].animindex + 5], (plr[0].x - 75) - cam.x, (plr[0].y - 100) - cam.y, plr[0].animframe, 150, 150, (plr[0].flags & FLAG_FLIPPED) ? 1 : 0);
+ drawSpriteSheeted(plr2sprites[(plr[1].flags & FLAG_HASCOAT) ? plr[1].animindex : plr[1].animindex + 5], (plr[1].x - 75) - cam.x, (plr[1].y - 100) - cam.y, plr[1].animframe, 150, 150, (plr[1].flags & FLAG_FLIPPED) ? 1 : 0);
if (fade != 0) {
SDL_SetRenderDrawColor(render, 0,0,0, fade);
@@ -388,16 +390,18 @@ void keys() {
if (keystates[SDL_SCANCODE_DOWN]) input_keys |= KEY_DOWN;
if (keystates[SDL_SCANCODE_Z]) input_keys |= KEY_GESTURE;
if (keystates[SDL_SCANCODE_ESCAPE]) input_keys |= KEY_MENU;
+
+ plr[0].input_keys = input_keys;
#if WTH_SDL_DEMOSUPPORT == 1
};
#endif
-
- if (keystates[SDL_SCANCODE_A]) xtrakeys |= KEY_LEFT;
- if (keystates[SDL_SCANCODE_D]) xtrakeys |= KEY_RIGHT;
- if (keystates[SDL_SCANCODE_W]) xtrakeys |= KEY_UP;
- if (keystates[SDL_SCANCODE_S]) xtrakeys |= KEY_DOWN;
- if (keystates[SDL_SCANCODE_X]) xtrakeys |= KEY_ATTACK;
-
+
+ if (keystates[SDL_SCANCODE_A]) plr[1].input_keys |= KEY_LEFT;
+ if (keystates[SDL_SCANCODE_D]) plr[1].input_keys |= KEY_RIGHT;
+ if (keystates[SDL_SCANCODE_W]) plr[1].input_keys |= KEY_UP;
+ if (keystates[SDL_SCANCODE_S]) plr[1].input_keys |= KEY_DOWN;
+ if (keystates[SDL_SCANCODE_Q]) plr[1].input_keys |= KEY_GESTURE;
+
if (controllerinput) {
printf("Registering controller input...\n");
#if WTH_SDL_DEMOSUPPORT == 1
@@ -529,6 +533,17 @@ int main(int argc, char *argv[]) {
plrsprites[8] = IMG_LoadTexture(render, "sprites/plr_asleep.png");
plrsprites[9] = IMG_LoadTexture(render, "sprites/plr_idle1.png");
+ plr2sprites[0] = IMG_LoadTexture(render, "sprites/mp/plr_idle.png"); // COATED
+ plr2sprites[1] = IMG_LoadTexture(render, "sprites/mp/plr_walk.png");
+ plr2sprites[2] = IMG_LoadTexture(render, "sprites/mp/plr_enterdoor.png");
+ plr2sprites[3] = IMG_LoadTexture(render, "sprites/mp/plr_asleep.png");
+ plr2sprites[4] = IMG_LoadTexture(render, "sprites/mp/plr_idle1.png");
+ plr2sprites[5] = IMG_LoadTexture(render, "sprites/mp/plr_idle_coatless.png"); //C COATLESS
+ plr2sprites[6] = IMG_LoadTexture(render, "sprites/mp/plr_walk_coatless.png");
+ plr2sprites[7] = IMG_LoadTexture(render, "sprites/mp/plr_enterdoor_coatless.png");
+ plr2sprites[8] = IMG_LoadTexture(render, "sprites/mp/plr_asleep.png");
+ plr2sprites[9] = IMG_LoadTexture(render, "sprites/mp/plr_idle1.png");
+
sprites[WTH_SPR_MENU] = IMG_LoadTexture(render, "sprites/MENU.png");
sprites[WTH_SPR_FONTMAP] = IMG_LoadTexture(render, "sprites/texts/fontmap.png");
sprites[WTH_SPR_MENUBUTTONS] = IMG_LoadTexture(render, "sprites/MENUBUTTONS.png");
diff --git a/sprites/mp/plr_asleep.png b/sprites/mp/plr_asleep.png
new file mode 100755
index 0000000..9413e10
Binary files /dev/null and b/sprites/mp/plr_asleep.png differ
diff --git a/sprites/mp/plr_asleep_coated.png b/sprites/mp/plr_asleep_coated.png
new file mode 100755
index 0000000..096f133
Binary files /dev/null and b/sprites/mp/plr_asleep_coated.png differ
diff --git a/sprites/mp/plr_enterdoor.png b/sprites/mp/plr_enterdoor.png
new file mode 100755
index 0000000..f9cba85
Binary files /dev/null and b/sprites/mp/plr_enterdoor.png differ
diff --git a/sprites/mp/plr_enterdoor_coatless.png b/sprites/mp/plr_enterdoor_coatless.png
new file mode 100755
index 0000000..66ab89b
Binary files /dev/null and b/sprites/mp/plr_enterdoor_coatless.png differ
diff --git a/sprites/mp/plr_idle.png b/sprites/mp/plr_idle.png
new file mode 100755
index 0000000..6614b83
Binary files /dev/null and b/sprites/mp/plr_idle.png differ
diff --git a/sprites/mp/plr_idle1.png b/sprites/mp/plr_idle1.png
new file mode 100755
index 0000000..c30001e
Binary files /dev/null and b/sprites/mp/plr_idle1.png differ
diff --git a/sprites/mp/plr_idle1_coatless.png b/sprites/mp/plr_idle1_coatless.png
new file mode 100755
index 0000000..c30001e
Binary files /dev/null and b/sprites/mp/plr_idle1_coatless.png differ
diff --git a/sprites/mp/plr_idle_coatless.png b/sprites/mp/plr_idle_coatless.png
new file mode 100755
index 0000000..6f441b8
Binary files /dev/null and b/sprites/mp/plr_idle_coatless.png differ
diff --git a/sprites/mp/plr_walk.png b/sprites/mp/plr_walk.png
new file mode 100755
index 0000000..3ae5eee
Binary files /dev/null and b/sprites/mp/plr_walk.png differ
diff --git a/sprites/mp/plr_walk_coatless.png b/sprites/mp/plr_walk_coatless.png
new file mode 100755
index 0000000..ecba5c4
Binary files /dev/null and b/sprites/mp/plr_walk_coatless.png differ

Binary file not shown.

Before

Width:  |  Height:  |  Size: 732 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

View file

@ -1,215 +0,0 @@
This is a patch-mod for WtH that adds touchscreen controls
TOUCHSCREEN PATCH
diff --git a/main_sdl.c b/main_sdl.c
index 1a87149..cc48c1b 100644
--- a/main_sdl.c
+++ b/main_sdl.c
@@ -1,4 +1,5 @@
// SDL2 frontend for the game
+// MOD APPLIED: Touchscreen
#include <stdio.h>
@@ -53,6 +54,7 @@ SDL_Texture *wintext;
SDL_Texture *plrsprites[10];
SDL_Texture *sprites[20];
+SDL_Texture *touchsprites;
SDL_Rect dspdest_rect; // this is the DESTINATION, aka screen position
SDL_Rect fade_rect; // used for fading in/out
@@ -78,6 +80,10 @@ uint32_t demoPointer;
static const char str_wintitle[] = WINTITLE; // it's only here to cut down redundancies
#endif
+uint16_t tapposX;
+uint16_t tapposY;
+uint8_t tapping;
+
uint8_t sprites_replace[2];
void drawRepeatingSprite(SDL_Texture *sprite, int x, int y) { // this DOESN'T repeat yet, because I am big Stupid(TM)
@@ -279,6 +285,10 @@ void loadGame() {
};
void draw() {
+ #define TOUCH_UPBUTTONX 64
+ #define TOUCH_UPBUTTONY 192
+ #define TOUCH_ACTIONBUTTONX 348
+ #define TOUCH_ACTIONBUTTONY 192
switch (GAME_STATE)
{
case 0:
@@ -296,7 +306,6 @@ void draw() {
break;
}
drawTextString("ALPHA", 0, 0, 0, 0);
-
break;
case 1:
//SDL_FillRect(winsurf, NULL, 400);
@@ -376,109 +385,33 @@ void draw() {
drawSpriteSheeted(sprites[19], 0, 0, bookpage & 0x0F, 480, 270, 0);
break;
};
+ drawSpriteSheeted(touchsprites, TOUCH_UPBUTTONX, TOUCH_UPBUTTONY, 0, 32, 32, 0);
+ drawSpriteSheeted(touchsprites, TOUCH_UPBUTTONX - 32, TOUCH_UPBUTTONY + 32, 2, 32, 32, 0);
+ drawSpriteSheeted(touchsprites, TOUCH_UPBUTTONX, TOUCH_UPBUTTONY + 32, 1, 32, 32, 0);
+ drawSpriteSheeted(touchsprites, TOUCH_UPBUTTONX + 32, TOUCH_UPBUTTONY + 32, 3, 32, 32, 0);
+ drawSpriteSheeted(touchsprites, TOUCH_ACTIONBUTTONX, TOUCH_ACTIONBUTTONY, (!GAME_STATE) ? 4 : 6, 32, 32, 0);
+ drawSpriteSheeted(touchsprites, TOUCH_ACTIONBUTTONX + 32, TOUCH_ACTIONBUTTONY, 5, 32, 32, 0);
+ if (GAME_STATE == 1) {
+ drawSpriteSheeted(touchsprites, 32, 32, 7, 32, 32, 0);
+ };
};
uint8_t *keystates;
SDL_Joystick *controllerinput;
void keys() {
- #if WTH_SDL_DEMOSUPPORT == 1
- if (demoStatus != 2) {
- #endif
- if (keystates[SDL_SCANCODE_LEFT]) input_keys |= KEY_LEFT;
- if (keystates[SDL_SCANCODE_RIGHT]) input_keys |= KEY_RIGHT;
- if (keystates[SDL_SCANCODE_UP]) input_keys |= KEY_UP;
- if (keystates[SDL_SCANCODE_DOWN]) input_keys |= KEY_DOWN;
- if (keystates[SDL_SCANCODE_Z]) input_keys |= KEY_JUMP;
- if (keystates[SDL_SCANCODE_ESCAPE]) input_keys |= KEY_MENU;
- #if WTH_SDL_DEMOSUPPORT == 1
- };
- #endif
-
- if (keystates[SDL_SCANCODE_A]) xtrakeys |= KEY_LEFT;
- if (keystates[SDL_SCANCODE_D]) xtrakeys |= KEY_RIGHT;
- if (keystates[SDL_SCANCODE_W]) xtrakeys |= KEY_UP;
- if (keystates[SDL_SCANCODE_S]) xtrakeys |= KEY_DOWN;
- if (keystates[SDL_SCANCODE_X]) xtrakeys |= KEY_ATTACK;
-
- if (controllerinput) {
- printf("Registering controller input...\n");
- #if WTH_SDL_DEMOSUPPORT == 1
- if (demoStatus != 2) {
- #endif
- if (SDL_JoystickGetButton(controllerinput, SDL_CONTROLLER_BUTTON_DPAD_LEFT) || SDL_JoystickGetAxis(controllerinput, SDL_CONTROLLER_AXIS_LEFTX) < -16383) input_keys |= KEY_LEFT;
- if (SDL_JoystickGetButton(controllerinput, SDL_CONTROLLER_BUTTON_DPAD_RIGHT) || SDL_JoystickGetAxis(controllerinput, SDL_CONTROLLER_AXIS_LEFTX) > 16383) input_keys |= KEY_RIGHT;
- if (SDL_JoystickGetButton(controllerinput, SDL_CONTROLLER_BUTTON_DPAD_UP) || SDL_JoystickGetAxis(controllerinput, SDL_CONTROLLER_AXIS_LEFTY) < -16383) input_keys |= KEY_UP;
- if (SDL_JoystickGetButton(controllerinput, SDL_CONTROLLER_BUTTON_DPAD_DOWN) || SDL_JoystickGetAxis(controllerinput, SDL_CONTROLLER_AXIS_LEFTY) > 16383) input_keys |= KEY_DOWN;
- if (SDL_JoystickGetButton(controllerinput, SDL_CONTROLLER_BUTTON_A)) input_keys |= KEY_JUMP;
- if (SDL_JoystickGetButton(controllerinput, SDL_CONTROLLER_BUTTON_START)) input_keys |= KEY_MENU;
- #if WTH_SDL_DEMOSUPPORT == 1
- };
- #endif
-
- if (SDL_JoystickGetAxis(controllerinput, SDL_CONTROLLER_AXIS_RIGHTX) < -16383) xtrakeys |= KEY_LEFT;
- if (SDL_JoystickGetAxis(controllerinput, SDL_CONTROLLER_AXIS_RIGHTX) > 16383) xtrakeys |= KEY_RIGHT;
- if (SDL_JoystickGetAxis(controllerinput, SDL_CONTROLLER_AXIS_RIGHTY) < -16383) xtrakeys |= KEY_UP;
- if (SDL_JoystickGetAxis(controllerinput, SDL_CONTROLLER_AXIS_RIGHTY) > 16383) xtrakeys |= KEY_DOWN;
- if (SDL_JoystickGetButton(controllerinput, SDL_CONTROLLER_BUTTON_X)) xtrakeys |= KEY_ATTACK;
- }
-
- #if EDITMODE == 1
- editkeys = 0;
- int mx, my;
- int win_width, win_height;
- SDL_GetMouseState(&mx, &my);
- SDL_GetWindowSize(win, &win_width, &win_height);
- if (keystates[SDL_SCANCODE_1]) addObject(
- (mx - cam.x) / (win_width / WIDTH),
- (my - cam.y) / (win_height / HEIGHT),
- INTERTYPE_COAT
- );
-
- if (keystates[SDL_SCANCODE_2]) editkeys = 1;
-
- if (editkeys != 0 && editkeys_prev == 0) {
- level++;
- LoadInRoom();
- };
- editkeys_prev = editkeys;
- editkeys = 0;
-
- if (keystates[SDL_SCANCODE_BACKSPACE]) {
- puts("== DEBUG PRINT START ==");
- printf("\n");
-
- printf("Game state: %i\n", GAME_STATE);
- printf("Current room: %i\n", level);
- puts("Current options:");
- printf("-- Fade ");
- puts( (options[0] & WTHOPTS_NOFADE) ? str_off : str_on);
- printf("-- Devcam ");
- puts( (options[0] & WTHOPTS_DEVCAM) ? str_on : str_off);
- printf("-- Censor Mode ");
- puts( (options[0] & WTHOPTS_CENSOR) ? str_on : str_off);
- printf("-- Music ");
- puts( (options[0] & WTHOPTS_DOSONG) ? str_on : str_off);
- printf("-- Double Res ");
- puts( (options[0] & WTHOPTS_2XSIZE) ? str_on : str_off);
- printf("-- Fullscreen ");
- puts( (options[0] & WTHOPTS_FULLSC) ? str_on : str_off);
- printf("\n");
-
- printf("Player position: (%i, %i)\n", plr.x, plr.y);
- if (plr.artifacts) {
- puts("Player has artifacts: ");
- if (plr.artifacts & ARTIFACT_BADGE) puts("-- ARTIFACT_BADGE");
- if (plr.artifacts & ARTIFACT_MIRROR) puts("-- ARTIFACT_MIRROR");
- if (plr.artifacts & ARTIFACT_KNIFE) puts("-- ARTIFACT_KNIFE");
- if (plr.artifacts & ARTIFACT_DONUT) puts("-- ARTIFACT_DONUT");
- } else puts("Player has no artifacts");
- printf("\n");
-
- printf("There are (meant to be) %i Interactibles in your level\n", interacts_count);
- puts("== DEBUG PRINT END ==");
- };
- #endif
+ // touchscreen inputs
+ if (!tapping) return;
+
+ #define TAPPEDBOX(x, y) tapposX >= x && tapposX < x + 32 && tapposY >= y && tapposY < y + 32
+
+ if (TAPPEDBOX(TOUCH_UPBUTTONX, TOUCH_UPBUTTONY)) input_keys ^= KEY_UP;
+ if (TAPPEDBOX(TOUCH_UPBUTTONX - 32, TOUCH_UPBUTTONY + 32)) input_keys ^= KEY_LEFT;
+ if (TAPPEDBOX(TOUCH_UPBUTTONX, TOUCH_UPBUTTONY + 32)) input_keys ^= KEY_DOWN;
+ if (TAPPEDBOX(TOUCH_UPBUTTONX + 32, TOUCH_UPBUTTONY + 32)) input_keys ^= KEY_RIGHT;
+ if (TAPPEDBOX(TOUCH_ACTIONBUTTONX, TOUCH_ACTIONBUTTONY)) input_keys ^= KEY_JUMP;
+ if (TAPPEDBOX(TOUCH_ACTIONBUTTONX + 32, TOUCH_ACTIONBUTTONY)) input_keys ^= KEY_ATTACK;
+ if (TAPPEDBOX(32, 32)) input_keys ^= KEY_MENU;
};
int main() {
@@ -551,6 +484,8 @@ int main() {
sprites[18] = IMG_LoadTexture(render, "sprites/artifacts_ff.png");
sprites[19] = IMG_LoadTexture(render, "sprites/book_hamie.png");
+ touchsprites = IMG_LoadTexture(render, "sprites/TOUCHSCREEN_buttons.png");
+
if (options[0] & WTHOPTS_CENSOR) {
sprites_replace[0] = 17;
sprites_replace[1] = 18;
@@ -567,6 +502,22 @@ int main() {
switch (event.type)
{
case SDL_QUIT: running = 0; break;
+ case SDL_MOUSEBUTTONDOWN:
+ tapposX = event.button.x;
+ tapposY = event.button.y;
+ tapping = 1;
+ break;
+ case SDL_MOUSEBUTTONUP:
+ tapping = 0;
+ break;
+ case SDL_FINGERDOWN:
+ tapposX = (int)(event.tfinger.x * WIDTH);
+ tapposY = (int)(event.tfinger.y * HEIGHT);
+ tapping = 1;
+ break;
+ case SDL_FINGERUP:
+ tapping = 0;
+ break;
}
}
keys();

View file

@ -1,8 +0,0 @@
Package: WakeToHell
Version: 0.3.1a
Architecture: all
Essential: no
Priority: optional
Depends: libsdl2-2.0-0, libsdl2-mixer-2.0-0, libsdl2-image-2.0-0
Maintainer: blitzdoughnuts
Description: A walking simulator / interactive story about a cat with chronic anxiety. Sometimes, you just wake to hell.

View file

@ -1,29 +0,0 @@
.TH man 6 "January 10th, 2025" "0.3.1a" "Wake to Hell manpage"
.SH NAME
WakeToHell - Game about a cat doctor in distress.
.SH SYNOPSIS
.B WakeToHell [-h]
.SH DESCRIPTION
Wake to Hell is a walking simulator / interactive story about a cat who seems to be dealing with some strong issues... to say the least.
.P
The game's defauklt controls on a keyboard are as follows:
.br
.B Left
and
.B right
arrows - Walk
.br
.B Up
arrow - Interact, go through doors
.br
.B Z
- Gesture / Confirm
.br
.SH EXAMPLES
What other examples?
.SH BUGS
There are some kinks including the possible insecurity of the SDL2 frontend's string drawing function, but otherwise there is nothing game-breaking.
.SH AUTHOR
blitzdoughnuts at doughnutsblitz@disroot.org
.SH COPYRIGHT
The game in its entirety, including code, assets, and story, are licensed under CC0. See LICENSES for additional copyright information.