Please Help
Author |
Message |
upthescale
|
Posted: Thu Mar 30, 2006 9:40 pm Post subject: Please Help |
|
|
ok i am making a game where the mosue is a box and u have to move it around inside a black box...meanwhile there other otherboxes flying around and you have to dodge them/..if u get hit u lose....now i am dont but a problem i am faicing is that the player can just go in a certain area and stay there cuz i didn't use randint on the boxes, so the player can stay in that area and win....how can i do it sooo i can that if the player's position is in one certain area fer a certain amount of time, it will say u lose ot whatever?
thanks |
|
|
|
|
|
Sponsor Sponsor
|
|
|
person
|
Posted: Thu Mar 30, 2006 9:46 pm Post subject: (No subject) |
|
|
no offense but can you plz type better so ppl can understand ur question??
if i understand ur question properly, try using Time.Elapse |
|
|
|
|
|
[Gandalf]
|
Posted: Thu Mar 30, 2006 9:47 pm Post subject: (No subject) |
|
|
Your post is a bit unclear, try to be a bit more descriptive (and use grammar/spelling!)
As for the timing, you would use the Time.Elapsed function, which returns the amount of milliseconds that have passed since the program started.
In your case, the code would look like this:
code: | var timeAtLastMovement : int
var timeLimit : int := 500 %in milliseconds
if mouse has moved then
timeAtLastMovement := Time.Elapsed
end if
if Time.Elapsed - timeAtLastMovement < timeLimit then
playerDies
end if |
That should be more than enough for you to get the idea... |
|
|
|
|
|
person
|
|
|
|
|
Clayton
|
Posted: Sat Apr 01, 2006 7:59 pm Post subject: (No subject) |
|
|
if u, for some reason cant get the link to work, it says:
DONT POST "I NEED HELP!" or "PLEASE HELP!" titles |
|
|
|
|
|
[Gandalf]
|
Posted: Sat Apr 01, 2006 8:02 pm Post subject: (No subject) |
|
|
Was that really neccessary? Do you truly believe that someone who is programming and using a forum can't click a link successfully? Please, avoid spamming like that in the future. This topic is basically solved now. |
|
|
|
|
|
|
|