Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
"wait"
Old
tovaanu
Guest
 
Status:
Posts: n/a
Default "wait" - 11-24-2009, 04:50 PM

Ok, i have something working properly but i need the "wait" enforced after x amount of times before the next action triggers.

Example:

System askes users 2 x 2?

If answer != 4
House Blows up

how do i put like a wait 4 seconds where by the user had 4 seconds to input the answer otherwise the house will blow up, this is to prevent the use of calculator etc... hope someone gets me o_o using a variable.
   
Reply With Quote
Old
zarfang8
Guest
 
Status:
Posts: n/a
Default 11-24-2009, 04:54 PM

Use a Boolean Variable.
If Answered=True, Win
If Answered=false, Blow up House.

Have it set to false when you start.
When You select 4, have answered set to True.
   
Reply With Quote
Old
tovaanu
Guest
 
Status:
Posts: n/a
Default 11-24-2009, 05:12 PM

Quote:
Originally Posted by zarfang8 View Post
Use a Boolean Variable.
If Answered=True, Win
If Answered=false, Blow up House.

Have it set to false when you start.
When You select 4, have answered set to True.
i understand what you are saying here but i thin you've mis read my question xD

I was alice to wait 4 seconds for an answer otherwise "House Blows Up"

so if the answer is 4 = Next Level
" " " Not 4 = House Blow up
If user doesn't answer in 4 seconds = House Blow Up


This is the job of "Wait" but i have no idea how to enforce it.
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Smile 11-24-2009, 05:23 PM

Make it so "while something is true", do wait 4 seconds and if you click or do whatever within those 4 seconds set to false, put the 4 seconds thing in "while" not in the beginning or the end.

While something is true
Begin
While=Do in order "wait 4 seconds then house blow up
End
------------
But
------------
if button pressed before the "while"action is finished
set to FALSE

Hope this helps


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
Reply With Quote
Old
reuben2011
Senior Member
 
reuben2011's Avatar
 
Status: Offline
Posts: 489
Join Date: Sep 2009
Location: Hawaii
Default 11-25-2009, 06:55 PM

Doesn't the world temporarily in a sense "stop" when a "ask user for [variable]" pops up? I do not think it is possible to stop the prompt before the answer is given. You could however use 3d text to ask the question and use an "when a key is typed" event.

Last edited by reuben2011; 11-25-2009 at 06:58 PM. Reason: adding on
   
Reply With Quote
Old
zarfang8
Guest
 
Status:
Posts: n/a
Default 11-25-2009, 07:29 PM

Quote:
Originally Posted by tovaanu View Post
i understand what you are saying here but i thin you've mis read my question xD

I was alice to wait 4 seconds for an answer otherwise "House Blows Up"

so if the answer is 4 = Next Level
" " " Not 4 = House Blow up
If user doesn't answer in 4 seconds = House Blow Up


This is the job of "Wait" but i have no idea how to enforce it.
Do you mean you don't know how to wait?
It's easy. you just drag, "Wait" into your method, and set it to 4=seconds. it is under Do in Order to the right of the methods tab. It is next to Print and the White "Comment" button.
   
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.