SDL 2 Made Easy Tutorial 15 - Timers [FPS]

preview_player
Показать описание

Also follow me on social media :D

Steam ID: CodingMadeEasy

Feel free to download my apps as well!

Driving Frenzy
----------------------------

Рекомендации по теме
Комментарии
Автор

Once again thank you! I watched another tutorial for this topic and they hard coded a bunch of numbers and didn't really explain what they were for. Of course, the hard coded numbers didn't work well with my system so I messed around with the numbers a bunch until I got it looking nice but I had no clue as to what exactly I was changing. Now I know!

lgbtqgacha
Автор

What you can do also is to "Cap the FrameRate". For instance many games are running at 60fps. So for instance if you are running at 120fps, you will tell SDL to wait 500ms with SDL_Delay. Since all computres are fast (or at least ruuning  > than 60fps) you can do that, and it's much more easy to implement :p.
 But dont do that for mobile platforms

sociamix
Автор

Could you do a tutorial on how to created a timed event? Say I want to spawn/draw a "power up" but only give you 5 seconds to pick it up before it despawns. How would one do something like this? A tutorial would be great.

SoloR
Автор

, it might help my sprite not delay -_-, when i change the playerRect.x then play the sprite by pressing the awsd, the animation delay, it turns fast, but the sprite is delay changing its playerRect.y, its stop 1 second,

nanishine
Автор

How does it come you have no error while adding float type to int?
I mean playerPosition.x += movementSpeed * deltaTime;
playerPosition.x is int while movementSpeed and deltaTime are floats.

BTW for me it moves faster left or up than down or right, any clues why?

komandor
Автор

I have a gaming headset and I heard low bass sounds in the background in your video, any idea what it could be?

HugoIetsGaming
Автор

Question... is it not a good idea to use an enum to change the move speed so as to reflect walking/running or speed boosts? My understanding of enums are they are actually ints but the move speed in your tutorial made it a float. So I guess they better question would be is it bad to use an int for move speed?

lgbtqgacha
welcome to shbcf.ru