From de911e4fe4931d3d489a0d3bbb1658632ff83f70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Sun, 16 Aug 2020 12:06:24 +0200 Subject: [PATCH] Add setting --- TODO.txt | 26 +++++++++++++------------- assets/levelA.gif | Bin 4772 -> 4765 bytes constants.h | 2 +- main.c | 14 +++++++++----- settings.h | 9 ++++++++- 5 files changed, 31 insertions(+), 20 deletions(-) diff --git a/TODO.txt b/TODO.txt index 3a3e9e9..d516d43 100644 --- a/TODO.txt +++ b/TODO.txt @@ -88,7 +88,7 @@ level ideas: - narrow corridor with elevator - maze from walls and/or props DONE - narrow bridge with platformer elements over a hole full of enemies kinda -- server room +- server room kinda - window (low unpassable ceiling) through which finish can be seen from the start location of the level - three locked doors in a row at the beginning of the level, the player has @@ -96,47 +96,47 @@ level ideas: - office building - plasma bots guarding a big stock (store) of plasma ammo - warrior (enemy) right before the player at the start of the level -- T-shaped corridor in which two rocket-firing enemies stand facing each other DONE +- T-shaped corridor in which two rocket-firing enemies stand facing each other DONE so that the player can kill them by stepping between them, letting them fire, then stepping back, making them kill each other - enemy trapped between barrels - teleport that leads to another teleport which is on a single high elevated square from which the player has to jump down and won't be able to return, making it a de-facto one-way teleport -- teleports placed so that the player can shoot himself with a rocket or plasma +- teleports placed so that the player can shoot himself with a rocket or plasma DONE (for fun) - exploders in a maze, hiding behind corners - teleport leading to a center of big room full of enemies -- easter egg -- a level that looks funny on the map, e.g. forms a text or a DONE +- easter egg -- a level that looks funny on the map, e.g. forms a text or a DONE picture - squeezers with low-elevated base (a hole), on a side of a corridor -- if the player is curious and jumps in, he's doomed to die -- perhaps there can be many of them while one is in fact an elevator, which the player has to spot and take in order to advance -- bullet-shooting enemies behing windows (low ceilings) in rooms that can't be DONE +- bullet-shooting enemies behing windows (low ceilings) in rooms that can't be DONE reached -- locked door that cannot be unlocked at the beginning of the level as a DONE +- locked door that cannot be unlocked at the beginning of the level as a DONE visual indication of entrance -- elevator in a narrow (1 square) vertical hole with doors at the top and DONE +- elevator in a narrow (1 square) vertical hole with doors at the top and DONE bottom, looking like an actual elevator in buildings -- player goes through a difficult platformer section and at the end has to make DONE +- player goes through a difficult platformer section and at the end has to make DONE takes card and has to go through the whole section again in order to also take the other one -- big platform made of elevators that are moving in a short vertical distance, DONE +- big platform made of elevators that are moving in a short vertical distance, DONE giving an impression of a shaking, unstable platform - warrior and/or exploder right behing doors - tight maze made of barrels filled with warriors in which the player has to only use knife in order not to explode the barrels and hurt himself -- enemy on an elevator that doesn't stop at aligned with the floor, so that DONE +- enemy on an elevator that doesn't stop at aligned with the floor, so that DONE the enemy is "trapped" on it and only appears briefly to shoot at the player - barrel on elevator - platforming vertical section in which the player is going upwards out of a big hole -- level with a lot of closed doors, done by including a door texture in the DONE +- level with a lot of closed doors, done by including a door texture in the DONE level wall textures and then sing it for "fake" doors -- invisible bridge (perhaps not straight) made of blockers (invisible walls) kinda +- invisible bridge (perhaps not straight) made of blockers (invisible walls) kinda over a hole, leading to an easter egg -- start of level: a corner blocked by an invisible wall, to indicate entrance DONE +- start of level: a corner blocked by an invisible wall, to indicate entrance DONE - small pyramid from diffetently elevated floor tiles bugs: diff --git a/assets/levelA.gif b/assets/levelA.gif index f5838c12229e867767270e8583d1c332773ba7a3..874944d5ec56e0b1af5d1eb1de7b22df670c2b07 100644 GIT binary patch delta 3599 zcmV+q4)F1$C7mU(vIKwFX@{gvN;dW4cTZA<)dq-l<7PLie1^>J4wgi5P4Ch(&^pC(x-MWcTnYN)Ab;`PA|05p5U zCD29-Ev%6cHtTZLKlE z+l4pzcMT=Q^YzIFS2({Y-o(3Eek+2(KPEZ0QOb` zfF>jZ5G1UrDFc6LZfvGT2EwN)%oky=60_@B#q1`kpI+W+%<;#~UUEZn;hu~# zV=4n!En_c}Ynr(&8;Jjj7(>4EyFo1FYIyZlr!-}dkyg+xoAK&fjB{bk4 z8$CGT-+%+)YTe4wc502I3#!c!OK!K$mFw;E-kJNoamT%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=KW?D-iTdZHEKrSnOiWcs0IDxVvgrun(1 z25AIMS)Xp&9})_pa5|Z7%A*o$rCOS#6oH(|$(;Vq37yhOoz@v1E{dmlI;VdlL8O3M zr9-L_g1Vf|`JB-?oz-~;F*;^qb)Jnno{u`CH;SWJnxK_RsF-@Fo2sY@%BZ1wprcZ! zd~v66dIRE#rgrM5GO8x98mkC7t1_~sO!`;Anw`4ps#l7nzIv>cnXI(hrOv9S!m6lv zF{WxdtxgH8wd$!mN}&cRqS}9o4%}L+*V?S(YMB%it-tZB11YX>TCVJR73r$3KsvAO zTCYnfulPz6?wYRr+OK7*uMfJe0t=o58>|LO|2nP}+pia^ ztr?528#}EXI~qp;suN41Kq{%kda9A?qAVKzRnG!?a{&^F@d4f^4mN-L0n>sJB}=iq zF{w>zsx<1eIO?(h0JFZp6dy3NHG8u;OR_ubk1N`#%sQkgtE3eHGDeHEN}EMCD-Jj- zEjmk}_K=|=%NI!DwBaeIPs$leN~}iur`QS-mC^^emaR_pQHEnCEacf(}+qeLkyZl+X=s>;CnEI$yi=@rFCeQo1;W>Y{{|LT6y1V(=yN!ap zp}Vqws=mz16UJ+{=->~I%eLC9y&WpFV~VuU3%b}VwJIyRQ#!OJ>bvMEzUW}UUkbUr zYiI=gkJ5_{2FkJI8?hjPzQuUK7@WZxoWc0position.x -#if SFG_BACKGROUND_BLUR != 0 + #if SFG_BACKGROUND_BLUR != 0 + SFG_backgroundBlurOffsets[SFG_backgroundBlurIndex] -#endif + #endif ) * SFG_RAYCASTING_SUBSAMPLE + SFG_game.backgroundScroll) % SFG_GAME_RESOLUTION_Y], (SFG_game.backgroundScaleMap[(pixel->position.y // ^ TODO: get rid of mod? -#if SFG_BACKGROUND_BLUR != 0 + #if SFG_BACKGROUND_BLUR != 0 + SFG_backgroundBlurOffsets[SFG_backgroundBlurIndex + 1] -#endif + #endif ) % SFG_GAME_RESOLUTION_Y ]) ); -#if SFG_BACKGROUND_BLUR != 0 + #if SFG_BACKGROUND_BLUR != 0 SFG_backgroundBlurIndex = (SFG_backgroundBlurIndex + 1) % 0x07; + #endif +#else + color = 1; #endif } diff --git a/settings.h b/settings.h index 7f5096e..3e75625 100644 --- a/settings.h +++ b/settings.h @@ -264,6 +264,13 @@ /** Gives player all keys from start. */ -#define SFG_UNLOCK_DOOR 1 +#define SFG_UNLOCK_DOOR 0 + +/** + Whether levels background (in distance or transparent wall textures) should + be drawn. If turned off, the background will be constant color, which can + noticably increase performance. +*/ +#define SFG_DRAW_LEVEL_BACKGROUND 1 #endif // guard