
-----------------------------------
Zeppelin
Sun Dec 02, 2007 4:05 pm

Timing Problem
-----------------------------------
Ok I'm working on an RPG for my Grade 10 ISP and I want to make a Paper Marioish battle system. One of the things I need to do is a random button press as in the computer generates a random number and the player has to push the coresponding key within the time limit. Now I got the key pressing part to work but I can't get the time limit. I'm using a counter instead of Time.Elapsed. Here's what I have so far.


var Action : int
var Timing : int

randint (Action,1,2)

Timing := 0

put Action

loop
var ch : string (1)
            getch (ch)
            
            Timing := Timing + 1
            
            if Action = 1 and ch = "a" and Timing  