rapiz1 / DungeonRush

πŸ‘ΎπŸ A opensource game inspired by Snake, written in pure C with SDL
GNU General Public License v3.0
2k stars 294 forks source link

Feature: flag to adjust speed or difficulty #35

Open daitangio opened 3 years ago

daitangio commented 3 years ago

The game is great! But my daughter is too young and the game too fast. I'd like to add an option to adjust speed. Where should should I start looking for?

rapiz1 commented 3 years ago

Thanks for playing! I suggest investigating function gameLoop. Not far from main.

---Original--- From: "Giovanni @.> Date: Sun, Aug 29, 2021 18:54 PM To: @.>; Cc: @.***>; Subject: [rapiz1/DungeonRush] Feature: flag to adjust speed or difficulty (#35)

The grame is great! But my daugther is too young and the game too fast. I'd like to add an option to adjust speed. Where should should I start looking for?

β€” You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

daitangio commented 3 years ago

Hi! I was unable to find something related to "speed" inside gameLoop. I tried to put some unix usleep call but it slowdown entirely the SDL library and it is bad (so I reverted it). I have noticed there is a snake-slowdown effect and it seems related to updateBuffDuration (see player.h buffs variable inside Snake struct). Some advices to slow down te entire game (enemies, snake and so on...)?

In the meantime I have increased "herosSetting" which drives the number of heros which appears... https://github.com/daitangio/DungeonRush/tree/feature/speed-ajust I am still working on it anyway