Pages: 1
Topic closed
How can the user input values into variables (while the program is running) such as an inputbox with prompt. The simple scenario is that if variable 'testresult' is >10 then sprite moves forward 50, else sprite moves backward 50 steps. Cheers, Kev
Offline
are you talking about a slider?
Offline
stonefruited wrote:
How can the user input values into variables (while the program is running) such as an inputbox with prompt. The simple scenario is that if variable 'testresult' is >10 then sprite moves forward 50, else sprite moves backward 50 steps. Cheers, Kev
For simple input, you can set the variable watcher (on the stage) to a slider which lets the user change the variable value by moving the slider with the mouse. Right-click on the variable watcher and pick the slider option.
For larger numbers, if you want the user to be able to type them in, there is no built-in method. You can, however, capture the number keys when they are pressed and build up an input value. Here is a project that shows one approach:
http://scratch.mit.edu/projects/Paddle2SeeFixIt/145585
Offline
what are variables
Offline
thomastoxic wrote:
what are variables
Hey thomastoxic! Here is a link I found that talks about what variables are and how they are used. Hope you find it useful!
http://scratch.mit.edu/forums/viewtopic.php?id=1346
Offline
Topic closed
Pages: 1