Help with a 2-D game

This is a discussion on Help with a 2-D game within the Game Programming forums, part of the General Programming Boards category; Hey,
I'm working on a 2-D game currently where i'm stuck in the mid-way. The problem is that i'm unable ...

Help with a 2-D game

Hey,

I'm working on a 2-D game currently where i'm stuck in the mid-way. The problem is that i'm unable to implement a timer which executes with another function simultaneously. I know i have to use threads but i'm a beginner and i don't have the slightest clue on how to initialize threads. I'm looking for something other than threads which can get me out of this.

If you have a timer in a game that has to show ticking seconds ... use the wall clock time for it? Via the gettime() function?

If you are wondering about how to do say 11:59, where the colon blinks on and off every second, then look at the ti_hund field (hundredths of a seconds) in the structure gettime() fills in. If it is less than 50, draw a colon, otherwise draw a space.

If you want N periods in a second, then draw a colon if ((.ti_hund * N) % 100 < 50), a space otherwise.

@Nominal Animal - remember, the OP is working in "emulated TurboC", so it's twice removed from being anywhere near a decent system.

I remembered; the gettime() function should be available in that environment.

It's frigging frustrating, though, to work in such an environment. It might be interesting if it was for a purpose -- say you're specializing in fixing old factory robots or something --, but I don't think that's the case here (at cprogramming.com) that I've seen; you'd first teach current systems, then the differences to old systems, I think. I believe the choice of "Turbo C" or "emulated Turbo C" is just due to the sheer stupidity/laziness of the instructor/institution, and an absolutely colossal waste of resources.

Not just because these students will learn stuff they won't be able to use in real life, but because they will have to un-learn the bad habits they will learn, before they can learn how to work with current systems. That unavoidable un-learning step is the one that really makes me sad: just think of the wasted effort and the amount of frustration that ensues, for absolutely no gain whatsoever.

Worse yet: these programmers may eventually write utilities and applications that I will use, and I will get frustrated on how often they crash and how bad their user interfaces are. No, I find that unacceptable. If others want to torture themselves, let them; but keep them away from the open marketplace where I might be accidentally subjected to their twisted, sick output.