So basically, I'm making a simple pong game. You can see I made it so that everytime the ball collides with something, a hitmarker appears for a moment. But isnt this moment only one frame? Since render gets called a x times amount per second, while x is the fps. So what I realised is, what if someone who plays this game, plays with a slower framerate, then the hitmarker will be displayed longer.
TL;DR How do I let something render for a certain amount in seconds instead of frames, so that ppl with different fps get to see the image for the same amount of time.
Core: http://pastebin.com/QrJUxusR
Desktop: http://pastebin.com/i0w4H4Wq
Dew class: http://pastebin.com/wuPnUBbg
You need to store the time when you did draw the hitmarker the first time plus the time how long it should be drawn in milliseconds. Now you know that you can draw the hitmarker as long the stored time is greater than the current time..
Pseudo code:
}