5 player gaming program :idea:
Author |
Message |
viks101
|
Posted: Mon Jun 05, 2006 9:31 pm Post subject: 5 player gaming program :idea: |
|
|
need feed back on creating a 5 player gaming program in which the players have to press one of the 5 buttons before the buzzer, however if they press it before they should immediately get disqualified. How can i store the input from the user before the program goes over the if statements
Description: |
heres what the program does roughly but not fully functional yet |
|
![](http://compsci.ca/v3/pafiledb/images/icons/clip.gif) Download |
Filename: |
GameShow.1.t |
Filesize: |
3.05 KB |
Downloaded: |
55 Time(s) |
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Clayton
![](http://compsci.ca/v3/uploads/user_avatars/1718239683472e5c8d7e617.jpg)
|
Posted: Mon Jun 05, 2006 10:32 pm Post subject: (No subject) |
|
|
just use your variables before your if statements ex
Turing: |
Input.KeyDown(keys )
if Time.Elapsed-timeSinceLast> 1000 then
put "Too quick"
else
%etc etc
end if
|
or else this might be something for *gulp* processes, although i would highly suggest you try different routes before you try processes
|
|
|
|
|
![](images/spacer.gif) |
TheOneTrueGod
![](http://www.drmcninja.com/images/mcninjab3.jpg)
|
Posted: Tue Jun 06, 2006 6:57 am Post subject: (No subject) |
|
|
Ugh, this is DEFINETLY not a situation for processes. The easiest way I can see to do this would be to have two loops, and to use your current method.
Pseudo Code:
code: |
Randomize the time you want to wait (In milliseconds)
loop
if they press their key now, tell them they lose, and set their respective flag to false
exit when Time.Elapsed > TimeAtStartOfGame + RandomizedWaitTime
end loop
drawfilloval(100,100,50,50,brightred) %Cuz I like a bright light rather than small text saying "Press your button now"
do a check to make sure that someone is still in the game
%Second loop
loop
exit when someone who wasn't disqualified presses their button.
end loop
Display the winner.
|
|
|
|
|
|
![](images/spacer.gif) |
|
|