Discuss Scratch
- Discussion Forums
- » Requests
- » do you need help with scripts
- Shopno3009
-
33 posts
do you need help with scripts
do you need to make complex code to solve a hard math removing some points i got a solution https://scratch-mit-edu.ezproxyberklee.flo.org/projects/608933527/
if you guys have a problem and post various scripts and examples and problems and i will help all i can and the community want to make portals https://scratch-mit-edu.ezproxyberklee.flo.org/projects/607983946/ solution and first introduce your self and you have to massage in here with solutions and problems if you are wandering how will your solution help the thing is you post your solution then when we get the question with the answer we are going to tell the person to follow you and they are going to get there solution and you are going to get a free follow we are helping new scratcher and scratchers
if you guys have a problem and post various scripts and examples and problems and i will help all i can and the community want to make portals https://scratch-mit-edu.ezproxyberklee.flo.org/projects/607983946/ solution and first introduce your self and you have to massage in here with solutions and problems if you are wandering how will your solution help the thing is you post your solution then when we get the question with the answer we are going to tell the person to follow you and they are going to get there solution and you are going to get a free follow we are helping new scratcher and scratchers
- supergamer10000
-
1000+ posts
do you need help with scripts
They should be making their own topics. Reporting to be closed 

- Paddle2See
-
1000+ posts
do you need help with scripts
I'll move this over to the Requests section for you - that's a better fit for this kind of topic 

- Shopno3009
-
33 posts
do you need help with scripts
example of a simple acceleration and declaration scripts
define speed x(joystick x)define(joystick y)how to use this
change [speed x] by ((0.9) * (joystick x))
change [speed y] by ((0.9) * (joystick y))
set [speed x] to ((0.9) * (speed x))
set [speed y] to ((0.9) * (speed y))
change x by (speed x)
change y by (speed y)
when green flag clicked
forever
move x (<key [right arrow] pressed?> - <key [left arrow] pressed?>)move y(<key [up arrow] pressed?> - <key [down arrow] pressed?>
Last edited by Shopno3009 (Nov. 30, 2021 11:14:23)
- Shopno3009
-
33 posts
do you need help with scripts
platformer scripts
control part
control part
when green flag clickedcolisons
set [gravity] to [-1.5]
set [jump force] to [12]
set [atenson] to [1.5]
set [resistance] to [0.8]
set [speed y] to [0]
forever
if <key [up arrow] pressed?> then
if <(falling) < [3]> then
set [speed y] to (jump force)
end
end
change [ speed x] by ((<key [right arrow] pressed?> - <key [left arrow] pressed?> * (atenson))
set [speed x] to ((speed x) * (resistance))
change [speed y] by (gravity)
move(([abs] of (speed x)) + ([abs] of (speed y))
end
define move(steps)
change [falling] by (1)
repeat (steps)
set [last valu] to (x position)
change x by ((speed x) / (steps))
if <touching color [put map color] ?> then
set x to (last valu)
set [speed x] to [0]
end
set [last valu] to (y position)
change y by ((speed y) / (steps))
if <touching color [put map color] ?> then
set y to (last valu)
if <(speed y) < [0]> then
set [falling] to [0]
end
set [speed y] to [0]
end
end
Last edited by Shopno3009 (Dec. 1, 2021 04:33:01)
- Shopno3009
-
33 posts
do you need help with scripts
if you have a song that you want to save but the song is too long for scratch to save i have the solutions:-
a) brake the music in different parts example
a) brake the music in different parts example
when green flag clickedb) download the project you will be able to hear the music but no-one else would be able to view the project unless you upload it to another service and share a link.
play sound [ v] until done
play sound [ v] until done
play sound [ v] until done
play sound [ v] until done
play sound [ v] until done
- Shopno3009
-
33 posts
do you need help with scripts
How to make a project broadcast to tell the right thing
put this code in a sprite with one pixel
put this code in a sprite with one pixel
when green flag clicked
forever
go to [mouse pointer]
if <<mouse down?> and <touching [correct answer] ?> then
broadcast [correct]
else
if <<mouse down?> and <not <touching [incorrect answer] ?> then
broadcast [incorrect]
end
end
end
- supergamer10000
-
1000+ posts
do you need help with scripts
Use the quote button to reply to comments. thanks
- Shopno3009
-
33 posts
do you need help with scripts
simple yes or no
simple yes or no
simple yes or no
when green flag clicked
forever
ask [is shopno3009 cool] and wait
if <<(answer) = [yes]> or <(answer) = [no]>> then
if <(answer) = [yes]> then
say [correct]
stop [this script]
else
if <(answer) = [no]> then
say [incorrect]
stop [this script]
end
end
else
say [unknown response]
end
end
- Shopno3009
-
33 posts
do you need help with scripts
ray cast
code for the map sprite
person sprite that walks around the map will be made.
Make a person sprite that has a one pixel by one pixel costume. The costume should be centered on the pixel. This is important.
Before diving into the sprite's scripts, note that all
speed
should be replaced with how fast the player needs to move.
Put these scripts in the “person” sprite:
next part all run without screen refers
Make a “distance sensing” sprite that has a one pixel by one pixel costume. The costume should be centered on the pixel.
Here is the information generated by “distance sensing” it taken and drawn. Remember, the more distant an object is, the smaller it is.
Make a “drawing” sprite with this script:
code for the map sprite
when green flag clicked
go to x: (0) y: (0)
set [ghost] effect to (100)
person sprite that walks around the map will be made.
Make a person sprite that has a one pixel by one pixel costume. The costume should be centered on the pixel. This is important.
Before diving into the sprite's scripts, note that all
speed
should be replaced with how fast the player needs to move.
Put these scripts in the “person” sprite:
when green flag clickedray caster
go to x: (0) y: (0)
set [ghost] effect to (100)
broadcast [sense] and wait
forever
if <key [right arrow] pressed?> then
turn cw (3) degrees
else
if <key [left arrow] pressed?> then
turn ccw (3) degrees
end
end
if <key [up arrow] pressed?> then
define move(speed)
else
if <key [down arrow] pressed?> then
define move((-1) * (speed))
end
broadcast [scan] and wait
end
end
define move(speed)
move (speed) steps
if <touching [map] ?> then
move ((0) - (speed)) steps
end
next part all run without screen refers
Make a “distance sensing” sprite that has a one pixel by one pixel costume. The costume should be centered on the pixel.
when green flag clickedDrawing
set [ghost] effect to (100)
when I receive [sense]
define sence
broadcast [draw] and wait
define sence
delete (all) of [distence]
set [distence] to [0]
set [angle offence] to [-48]
repeat (96)
set [distance] to [0]
go to [person]
point in direction (([direction] of [player]) + (angle offence))
repeat until <<touching [map] ?> or <(distance) = [80]>>
move (1) steps
change [distance] by (1)
end
add (distance) to [distance]
change [angle offence] by (1)
end
Here is the information generated by “distance sensing” it taken and drawn. Remember, the more distant an object is, the smaller it is.
Make a “drawing” sprite with this script:
when I receive [draw]
define draw
define draw
go to x: (-237.5) y: (180)
set pen size to (5)
set pen color to [#6664ee]
clear
pen up
set [Colom] to [1]
repeat (length of [distance] :: list)
set pen shade to ((50) + (((item (Colom) of [distances] :: list)) / ((50) * (80))))
set y to ((-1200) / ((item (Colom) of [distances] :: list)))
pen down
set y to ((-1200) / ((item (Colom) of [distances] :: list)))
pen up
change x by (5)
change [Colom] by (1)
end
- Shopno3009
-
33 posts
do you need help with scripts
okUse the quote button to reply to comments. thanks
- Paddle2See
-
1000+ posts
do you need help with scripts
It's really nice that you want to help out with a guide! However, we have a number of them in the forums already and we don't have a good way to showcase any more. If you want to make a guide in a Scratch project, that would be fine. You could advertise it in the “Show and Tell” section too.
There are lots of other ways to help out in the forums too. Helpful Scratchers are always welcome in the “Questions About Scratch”, “Help With Scripts”, “Requests” and other sections. Just look around and ask questions
There are lots of other ways to help out in the forums too. Helpful Scratchers are always welcome in the “Questions About Scratch”, “Help With Scripts”, “Requests” and other sections. Just look around and ask questions

- Discussion Forums
- » Requests
-
» do you need help with scripts