Hello,
I am a middle school technology teacher using Picoboards with my 7th grade students. We would like to use the slider function in a game of Pong where the handle is moved by moving the slider. We are having problems because the slider does not seem to go to the negative numbers on the screen, therefore only covering half the playing board. Not ideal as you can imagine. Can you please help? Any assistance would be most appreciated.
Sincerely,
Francessca Zammarano
Marymount School of NY
Offline
MsZ123 wrote:
Hello,
I am a middle school technology teacher using Picoboards with my 7th grade students. We would like to use the slider function in a game of Pong where the handle is moved by moving the slider. We are having problems because the slider does not seem to go to the negative numbers on the screen, therefore only covering half the playing board. Not ideal as you can imagine. Can you please help? Any assistance would be most appreciated.
Sincerely,
Francessca Zammarano
Marymount School of NY
Use a code like this (supposing slider is 1-100, never had one)
[WHEN GREEN FLAG CLICKED]
[FOREVER]
[IF < ([Slider] Sensor Value) < 51 >]
[Set X to (0 -( [Slider] Sensor Value) * 24)) (Negative of Slider Sensor Value * 24 to get something within bounds of -1 to -240)
[ELSE]
[Set X to (([Slider] Sensor Value) * 24)] (Slider sensor Value * 24 to get something within bounds of 1 to 240)
[(endif)]
Hope that Helps!
EDIT: Miscalculation.
I am a 7th grader! XD
Last edited by bbbeb (2011-01-19 16:16:41)
Offline
MsZ123 wrote:
THank you both! I will try it today!
You're welcome!
Just remember, the shorter the paddle, the more you will have to make the "2.5" bigger.
Offline