Add small updates

This commit is contained in:
Miloslav Číž 2020-09-14 16:40:26 +02:00
parent 57bc76e577
commit 8cb615efe6
9 changed files with 759 additions and 1604 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -114,7 +114,7 @@
/** /**
Maximum player health. Maximum player health.
*/ */
#define SFG_PLAYER_MAX_HEALTH 150 #define SFG_PLAYER_MAX_HEALTH 125
/** /**
Start health of player. Start health of player.
@ -528,7 +528,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(15,1000), /* fireball */ SFG_PROJECTILE_ATTRIBUTE(12,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)

10
game.h
View File

@ -4,6 +4,14 @@
Main source file of the game that puts together all the pieces. main game Main source file of the game that puts together all the pieces. main game
logic is implemented here. logic is implemented here.
Physics notes (you can break this when messing with constants):
- Lowest ceiling under which player can fit is 4 height steps.
- Widest hole over which player can run without jumping is 1 square.
- Widest hole over which the player can jump is 3 squares.
- Highest step a player can walk onto without jumping is 2 height steps.
- Highest step a player can jump onto is 3 height steps.
by Miloslav Ciz (drummyfish), 2019 by Miloslav Ciz (drummyfish), 2019
Released under CC0 1.0 (https://creativecommons.org/publicdomain/zero/1.0/) Released under CC0 1.0 (https://creativecommons.org/publicdomain/zero/1.0/)
@ -1467,7 +1475,7 @@ void SFG_init()
SFG_game.antiSpam = 0; SFG_game.antiSpam = 0;
SFG_game.settings = 0xff; SFG_game.settings = 0x03;
SFG_enableMusic(1); SFG_enableMusic(1);
SFG_LOG("computing average texture colors") SFG_LOG("computing average texture colors")

2325
levels.h

File diff suppressed because it is too large Load Diff

View File

@ -12,17 +12,21 @@
whatsoever. whatsoever.
*/ */
//#define SFG_LOG(str) printf("game: %s\n",str); // for debug only
#define SFG_FPS 30 #include <stdio.h>
#define SFG_TEXTURE_DISTANCE 5000 #define SFG_LOG(str) printf("game: %s\n",str); // for debug only
#define SFG_START_LEVEL 8
#define SFG_FPS 25
#define SFG_TEXTURE_DISTANCE 6000
#define SFG_SCREEN_RESOLUTION_X 110 #define SFG_SCREEN_RESOLUTION_X 110
#define SFG_SCREEN_RESOLUTION_Y 88 #define SFG_SCREEN_RESOLUTION_Y 88
#define SFG_RESOLUTION_SCALEDOWN 1 #define SFG_RESOLUTION_SCALEDOWN 1
#define SFG_DITHERED_SHADOW 0 #define SFG_DITHERED_SHADOW 0
#define SFG_FOG_DIMINISH_STEP 2048 #define SFG_FOG_DIMINISH_STEP 2048
#define SFG_RAYCASTING_MAX_STEPS 20 #define SFG_RAYCASTING_MAX_STEPS 20
#define SFG_RAYCASTING_MAX_HITS 6 #define SFG_RAYCASTING_MAX_HITS 5
#define SFG_RAYCASTING_SUBSAMPLE 2 #define SFG_RAYCASTING_SUBSAMPLE 2
#include "game.h" #include "game.h"
@ -160,6 +164,10 @@ int main()
{ {
if (pokitto.update()) if (pokitto.update())
{ {
if (SFG_game.frame % 32 == 0)
printf("%d\n",Pokitto::Core::fps_counter);
SFG_mainLoopBody(); SFG_mainLoopBody();
} }
} }

View File

@ -23,9 +23,11 @@
#define SFG_BACKGROUND_BLUR 1 #define SFG_BACKGROUND_BLUR 1
#define SFG_FPS 60
#define SFG_LOG(str) puts(str); #define SFG_LOG(str) puts(str);
#define SFG_START_LEVEL 6 #define SFG_START_LEVEL 8
#define SFG_IMMORTAL 1 #define SFG_IMMORTAL 1
// #define SFG_UNLOCK_DOOR 1 // #define SFG_UNLOCK_DOOR 1
#define SFG_REVEAL_MAP 1 #define SFG_REVEAL_MAP 1
@ -108,7 +110,7 @@ int8_t SFG_keyPressed(uint8_t key)
break; break;
case SFG_KEY_A: case SFG_KEY_A:
return sdlKeyboardState[SDL_SCANCODE_G]; return sdlKeyboardState[SDL_SCANCODE_G] || sdlKeyboardState[SDL_SCANCODE_RETURN];
break; break;
case SFG_KEY_B: case SFG_KEY_B:
@ -328,7 +330,7 @@ int main(int argc, char *argv[])
for (int i = 0; i < SFG_SFX_SAMPLE_COUNT; ++i) for (int i = 0; i < SFG_SFX_SAMPLE_COUNT; ++i)
audioBuff[i] = 127; audioBuff[i] = 127;
SDL_PauseAudio(0); // SDL_PauseAudio(0);
running = 1; running = 1;