Add setting

This commit is contained in:
Miloslav Číž 2020-08-16 12:06:24 +02:00
parent f94f9bbe89
commit de911e4fe4
5 changed files with 31 additions and 20 deletions

View File

@ -88,7 +88,7 @@ level ideas:
- narrow corridor with elevator - narrow corridor with elevator
- maze from walls and/or props DONE - maze from walls and/or props DONE
- narrow bridge with platformer elements over a hole full of enemies kinda - 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 - window (low unpassable ceiling) through which finish can be seen from the
start location of the level start location of the level
- three locked doors in a row at the beginning of the level, the player has - three locked doors in a row at the beginning of the level, the player has
@ -103,7 +103,7 @@ level ideas:
- teleport that leads to another teleport which is on a single high elevated - 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, square from which the player has to jump down and won't be able to return,
making it a de-facto one-way teleport 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) (for fun)
- exploders in a maze, hiding behind corners - exploders in a maze, hiding behind corners
- teleport leading to a center of big room full of enemies - teleport leading to a center of big room full of enemies

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -523,7 +523,7 @@ SFG_PROGRAM_MEMORY uint8_t SFG_attackDamageTable[SFG_WEAPON_FIRE_TYPES_TOTAL] =
SFG_PROGRAM_MEMORY uint8_t SFG_projectileAttributeTable[SFG_PROJECTILES_TOTAL] = SFG_PROGRAM_MEMORY uint8_t SFG_projectileAttributeTable[SFG_PROJECTILES_TOTAL] =
{ {
/* explosion */ SFG_PROJECTILE_ATTRIBUTE(0,400), /* explosion */ SFG_PROJECTILE_ATTRIBUTE(0,400),
/* fireball */ SFG_PROJECTILE_ATTRIBUTE(11,1000), /* fireball */ SFG_PROJECTILE_ATTRIBUTE(15,1000),
/* plasma */ SFG_PROJECTILE_ATTRIBUTE(20,500), /* plasma */ SFG_PROJECTILE_ATTRIBUTE(20,500),
/* dust */ SFG_PROJECTILE_ATTRIBUTE(0,450), /* dust */ SFG_PROJECTILE_ATTRIBUTE(0,450),
/* bullet */ SFG_PROJECTILE_ATTRIBUTE(28,1000) /* bullet */ SFG_PROJECTILE_ATTRIBUTE(28,1000)

14
main.c
View File

@ -795,22 +795,26 @@ void SFG_pixelFunc(RCL_PixelInfo *pixel)
} }
else else
{ {
#if SFG_DRAW_LEVEL_BACKGROUND
color = SFG_getTexel( color = SFG_getTexel(
SFG_backgroundImages[SFG_currentLevel.backgroundImage], SFG_backgroundImages[SFG_currentLevel.backgroundImage],
SFG_game.backgroundScaleMap[((pixel->position.x SFG_game.backgroundScaleMap[((pixel->position.x
#if SFG_BACKGROUND_BLUR != 0 #if SFG_BACKGROUND_BLUR != 0
+ SFG_backgroundBlurOffsets[SFG_backgroundBlurIndex] + SFG_backgroundBlurOffsets[SFG_backgroundBlurIndex]
#endif #endif
) * SFG_RAYCASTING_SUBSAMPLE + SFG_game.backgroundScroll) % SFG_GAME_RESOLUTION_Y], ) * SFG_RAYCASTING_SUBSAMPLE + SFG_game.backgroundScroll) % SFG_GAME_RESOLUTION_Y],
(SFG_game.backgroundScaleMap[(pixel->position.y // ^ TODO: get rid of mod? (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] + SFG_backgroundBlurOffsets[SFG_backgroundBlurIndex + 1]
#endif #endif
) % SFG_GAME_RESOLUTION_Y ]) ) % SFG_GAME_RESOLUTION_Y ])
); );
#if SFG_BACKGROUND_BLUR != 0 #if SFG_BACKGROUND_BLUR != 0
SFG_backgroundBlurIndex = (SFG_backgroundBlurIndex + 1) % 0x07; SFG_backgroundBlurIndex = (SFG_backgroundBlurIndex + 1) % 0x07;
#endif
#else
color = 1;
#endif #endif
} }

View File

@ -264,6 +264,13 @@
/** /**
Gives player all keys from start. 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 #endif // guard