I'm trying to make a basic snake game in C++, I made a basic grid with a orl[x] and ory[y] arrays, and now I'm trying to add the snake.
Basically I want the snake to move until a certain key is pressed and move one array at a time. I tried using something else than timers but it is executed instantly. I need a timer so that the snake keeps doing that every second until a key is pressed. If you ever played snake you know exactly what I mean.
I need to make a timer in C++, but I don't want to implement an ENORMOUS code by creating a timer and not understand anything from my own code. I want it as simple as possible.
Any idea how I could do this? I looked into the time header library but found nothing useful in there.