From 071ca8ec69c07edb32c32b20efc71f8a9015e935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Sat, 3 Oct 2020 20:29:15 +0200 Subject: [PATCH] Continue gamebuino --- constants.h | 21 ++++++++++++++------- main_gbmeta.ino | 7 +++++++ settings.h | 5 +++++ 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/constants.h b/constants.h index d3c9fd1..8b0a864 100644 --- a/constants.h +++ b/constants.h @@ -16,11 +16,6 @@ #ifndef _SFG_CONSTANTS_H #define _SFG_CONSTANTS_H -/** - How quickly player turns left/right, in degrees per second. -*/ -#define SFG_PLAYER_TURN_SPEED 210 - /** How quickly player moves, in squares per second. */ @@ -556,17 +551,29 @@ SFG_PROGRAM_MEMORY uint8_t SFG_attackDamageTable[SFG_WEAPON_FIRE_TYPES_TOTAL] = fff: half speed in game squares per second lllll: eigth of frames to live */ + +#define LOW_FPS (SFG_FPS < 20) ///< low FPS needs low speeds, because collisions + SFG_PROGRAM_MEMORY uint8_t SFG_projectileAttributeTable[SFG_PROJECTILES_TOTAL] = { /* explosion */ SFG_PROJECTILE_ATTRIBUTE(0,400), /* fireball */ SFG_PROJECTILE_ATTRIBUTE(10,1000), + +#if LOW_FPS + /* plasma */ SFG_PROJECTILE_ATTRIBUTE(17,500), +#else /* plasma */ SFG_PROJECTILE_ATTRIBUTE(18,500), +#endif + /* dust */ SFG_PROJECTILE_ATTRIBUTE(0,450), -#if SFG_FPS < 20 - /* bullet */ SFG_PROJECTILE_ATTRIBUTE(20,1000) // high speed could miss things + +#if LOW_FPS + /* bullet */ SFG_PROJECTILE_ATTRIBUTE(17,1000) #else /* bullet */ SFG_PROJECTILE_ATTRIBUTE(28,1000) #endif }; +#undef LOW_FPS + #endif // guard diff --git a/main_gbmeta.ino b/main_gbmeta.ino index 2a240f0..011d933 100644 --- a/main_gbmeta.ino +++ b/main_gbmeta.ino @@ -14,6 +14,9 @@ #include + #define SFG_IMMORTAL 1 + #define SFG_INFINITE_AMMO 1 + #define SFG_ARDUINO 1 #define SFG_CAN_EXIT 0 #define SFG_FPS 17 @@ -25,6 +28,7 @@ #define SFG_RAYCASTING_SUBSAMPLE 3 #define SFG_DIMINISH_SPRITES 0 #define SFG_DITHERED_SHADOW 0 +#define SFG_PLAYER_TURN_SPEED 150 #include "game.h" @@ -155,6 +159,9 @@ void loop() SFG_mainLoopBody(); +#if 0 + // debuggin performance gb.display.setCursor(1,1); gb.display.print(gb.getCpuLoad()); +#endif } diff --git a/settings.h b/settings.h index 106984a..3c93a4a 100644 --- a/settings.h +++ b/settings.h @@ -66,6 +66,11 @@ #define SFG_SCREEN_RESOLUTION_Y 600 #endif +/** + How quickly player turns left/right, in degrees per second. +*/ +#define SFG_PLAYER_TURN_SPEED 210 + /** Distance, in RCL_Units, to which textures will be drawn. Textures behind this distance will be replaced by an average constant color, which can help