This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-01-19 12:46:05

MsZ123
Scratcher
Registered: 2007-05-24
Posts: 6

Using Slider on Picoboard for game of Pong

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

 

#2 2011-01-19 16:11:58

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: Using Slider on Picoboard for game of Pong

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)


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#3 2011-01-20 06:52:40

-GizzardGulp-
Scratcher
Registered: 2010-03-05
Posts: 100+

Re: Using Slider on Picoboard for game of Pong

This is all you need:
http://i1118.photobucket.com/albums/k607/Max_Levine/thfg.gif


http://i1118.photobucket.com/albums/k607/Max_Levine/SnoutmolStudios.png

Offline

 

#4 2011-01-20 12:54:29

MsZ123
Scratcher
Registered: 2007-05-24
Posts: 6

Re: Using Slider on Picoboard for game of Pong

THank you both! I will try it today!

Offline

 

#5 2011-01-21 06:58:02

-GizzardGulp-
Scratcher
Registered: 2010-03-05
Posts: 100+

Re: Using Slider on Picoboard for game of Pong

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.


http://i1118.photobucket.com/albums/k607/Max_Levine/SnoutmolStudios.png

Offline

 

Board footer