
-----------------------------------
Morice
Sat Dec 24, 2005 10:25 pm

Any other way besides Time.Elapsed...  :?:
-----------------------------------
Ok i was wondering if ther is another to count time in my game besdies Time.Elapsed because i cant do nothing with it just to display the time....
i need to add stats and i cant do u cause i cant stop Time.Elapsed... 
so is ther another way to make time? plz help, cause its really frustrating....

-----------------------------------
Cervantes
Sat Dec 24, 2005 11:43 pm


-----------------------------------
There's no problem with Time.Elapsed.

You'll have to post some code.

-----------------------------------
Morice
Sun Dec 25, 2005 1:32 pm


-----------------------------------
ok heres the problem
i have a racing game right
and each track contains of 5 laps and all of it its timed and im using Time.Elapsed....
however i want to have at the end of each track to display the stats like lap 1 u did it in **** secs or lap 2 in **** secs 
and i cant use that with time.elapsed because i cant ( or i dont know) assign a variable to it at a certain point ...
do u know wat i mean??

-----------------------------------
Cervantes
Sun Dec 25, 2005 1:58 pm


-----------------------------------
Time.Elapsed is a function: it returns a value.  You can assign that value to a variable.

var time_now := Time.Elapsed


Then you can determine the time between two events by subtracting Time.Elapsed from the value of the variable, time_now:

put "The time between these two events is ", Time.Elapsed - time_now


-----------------------------------
Morice
Sun Dec 25, 2005 2:16 pm


-----------------------------------
omg lol im so dum i just figured wat i did wrong lol thanks cervantes

-----------------------------------
Morice
Sun Dec 25, 2005 2:17 pm


-----------------------------------
lol never mind... i cant do it maybe u can help me ... heres the code

%--------------------------------------------------First Good Game-----------------------------------------------------%
%-----------------------------------------------------By Marius--------------------------------------------------------%


setscreen ("graphics:640;480,nobuttonbar,position:192;100,noecho")
var chars : array char of boolean
var score : array 1 .. 5 of int := init (0, 0, 0, 0, 0)
var x, y : int
var x2, y2 : int
var counter4 : int := 0
var counter, counter3 : int := 0
var font, font2, font3, font4 : int
var this : string
var timeRunning : int
var counter2 : int := 0
var endStatement : int


font4 := Font.New ("Comic Sans MS:60:bold")
font := Font.New ("Comic Sans MS:10:bold")
font2 := Font.New ("Comic Sans MS:30:bold")
font3 := Font.New ("Comic Sans MS:13:bold")
x := 285
y := 30
x2 := 285
y2 := 15

%---------------------------------------------------Background----------------------------------------------------------%
proc backgr
    drawfillbox (0, 0, maxx, maxy, 121)

    for i : 1 .. 6
        drawbox (0 + i, 0 + i, maxx - i, maxy - i, 69)
    end for

    drawbox (6, 6, maxx - 6, maxy - 6, black)

end backgr
backgr
drawbox (6, 406, maxx - 6, maxy - 6, black)
drawfillbox (7, 407, maxx - 7, 472, 3)
drawfillbox (90, 427, 95, 472, 69)
drawfillbox (195, 407, 200, 472, 69)
drawline (7, 427, 195, 427, 69)
drawfillbox (1, 400, maxx - 1, 405, 69)

%-------------------------------------------------Background end-------------------------------------------------------%
Font.Draw ("Player 1", 10, 460, font, 69)
Font.Draw ("Lap: ", 10, 430, font, 69)
Font.Draw ("Player 2", 100, 460, font, 69)
Font.Draw ("Lap:", 100, 430, font, 69)
Font.Draw ("Time: ", 67, 410, font3, 69)
proc countdown
    Font.Draw (" 3 ", 285, 80, font4, 69)
    delay (1000)
    drawfillbox (285, 71, 430, 150, 21)
    Font.Draw (" 2 ", 285, 80, font4, 69)
    delay (1000)
    drawfillbox (285, 71, 430, 150, 21)
    Font.Draw (" 1 ", 285, 80, font4, 69)
    delay (1000)
    drawfillbox (285, 71, 430, 150, 21)
    Font.Draw (" Go!!! ", 235, 80, font4, 69)
    delay (1000)
    drawfillbox (270, 71, 430, 150, 21)
end countdown
%-----------------------------------------------------Track------------------------------------------------------------%
proc start
    drawfillbox (300, 11, 304, 40, 0) %
    drawfillbox (300, 16, 304, 22, 7) %