Hello, Im new here, and to programming as well.
After walking through some basic tutorials I thought it would be nice to try something myself, though Ive ran into some trouble:
I'd like to make some simple game that will have a timed tick rate and operate according to it - say the loop only lasts 0.1 secons.
I can make the loop wait for that given time like this:
Though I'd also like to read for input - like most games do - this is where I run into a problem: reading for input stops the loop from continuing until it reads it, and I basically want the game to continue ticking no matter what / stop reading for input after x amount of time.Code:void main() { while (x) { printmaze(); monstermove(); readinput(c); playermove(c); wait(time); } return }
What approach should I be taking? Any suggestions are welcome, thanks.