Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » List of Helpful Topics for Scripting
- ComputerGames4U
- Scratcher
100+ posts
List of Helpful Topics for Scripting
Do you know how to make a platformer script?
when green flag clicked
set [ y] to [0]
set [ x] to [0]
forever
change [ y] by (-1)
if <key [ Right arrow] pressed?> then
change [ x] by (1)
end
if <key [ Left arrow] pressed?> then
change [ x] by (-1)
end
set [ x] to ((x) * (0.9))
change x by (x)
if <touching color [#3c3f50] ?> then
change y by (1)
if <touching color [#3c3f50] ?> then
change y by (1)
if <touching color [#3c3f50] ?> then
change y by (1)
if <touching color [#3c3f50] ?> then
change y by (1)
if <touching color [#3c3f50] ?> then
change y by (1)
change x by ((x) * (-1))
change y by (-5)
end
end
end
end
end
change y by (y)
if <touching color [#3c3f50] ?> then
change y by ((y) * (-1))
set [ y] to [0]
end
change y by (-1)
if <<key [ up arrow] pressed?> and <touching color [#3c3f50] ?>> then
set [ y] to [13]
end
change y by (1)
end
Last edited by ComputerGames4U (Jan. 18, 2017 23:01:11)
- -Prion-
- Scratcher
31 posts
List of Helpful Topics for Scripting
Do you know how to make a logo?
ILYWのメインアカウントです。(引っ越ししました)フォローよろでーす
- asivi
- Scratcher
1000+ posts
List of Helpful Topics for Scripting
Do you know how to make a logo?https://scratch.mit.edu/search/studios?q=logo/ some Studios where you can get inspired.
- Enchanting-Rose
- New to Scratch
1 post
List of Helpful Topics for Scripting
Hey
Sorry, I cant quite figure out whats wrong with my script even though I'm sure its right.
PLEASE can you help me correct my error somewhere and make it work. Can you answer this as soon as you can. Btw, its called Ultimate Hogwarts Sorting Hat Quiz.
Thanks
Sorry, I cant quite figure out whats wrong with my script even though I'm sure its right.
PLEASE can you help me correct my error somewhere and make it work. Can you answer this as soon as you can. Btw, its called Ultimate Hogwarts Sorting Hat Quiz.
Thanks
- gorrilagrant
- Scratcher
7 posts
List of Helpful Topics for Scripting
I need help with this https://scratch.mit.edu/projects/138580390/
- -Affinity-
- Scratcher
58 posts
List of Helpful Topics for Scripting
Well this is helpfulDo you know how to make a platformer script?when green flag clickedset [ y] to [0]set [ x] to [0]forever
change [ y] by (-1)
if <key [ Right arrow] pressed?> then
change [ x] by (1)
end
if <key [ Left arrow] pressed?> then
change [ x] by (-1)
end
set [ x] to ((x) * (0.9))
change x by (x)
if <touching color [#3c3f50] ?> then
change y by (1)
if <touching color [#3c3f50] ?> then
change y by (1)
if <touching color [#3c3f50] ?> then
change y by (1)
if <touching color [#3c3f50] ?> then
change y by (1)
if <touching color [#3c3f50] ?> then
change y by (1)
change x by ((x) * (-1))
change y by (-5)
end
end
end
end
end
change y by (y)
if <touching color [#3c3f50] ?> then
change y by ((y) * (-1))
set [ y] to [0]
end
change y by (-1)
if <<key [ up arrow] pressed?> and <touching color [#3c3f50] ?>> then
set [ y] to [13]
end
change y by (1)
end
- BenSchell
- Scratcher
1 post
List of Helpful Topics for Scripting
i have a question how do i get scratch to recognize when my score gets to a cretian number
- -Affinity-
- Scratcher
58 posts
List of Helpful Topics for Scripting
Yes finally something helpful this is a platformer script. hope you find it helpful.when green flag clicked
forever
change [ y] by (-0.5)
if <key [ right arrow] pressed?> then
change [ x] by (1)
end
if <key [ left arrow] pressed?> then
change [ x] by (-1)
end
set [ x] to ((x) * (0.9))
change x by (x)
if <touching color [black]?> then
change y by (1)
if <touching color [black]?> then
change y by (1)
if <touching color [black]?> then
change y by (1)
if <touching color [black]?> then
change y by (1)
if <touching color [black]?> then
change y by (1)
if <touching color [black]?> then
change y by (1)
if <touching color [black]?> then
change y by (-6)
if <key [up arrow] pressed?> then
set [y] to [10]
if <(x) < [0]> then
set [x] to [10]
end
if <not <(x) < [0]>> then
set [ x] to [-10]
end
end
if <not <key [up arrow] pressed?>> then
change x by ((x) * (-1))
set [x] to [0]
end
end
end
end
end
end
end
end
change y by (y)
if <touching color [black]?> then
change y by ((y) * (-1))
set [y] to [0]
end
change y by (-0.5)
if <<touching color [black]?> and <key [up arrow] pressed?>> then
set [y] to [10]
end
change y by (0.5)
end
- SecretGorilla89
- Scratcher
32 posts
List of Helpful Topics for Scripting
Hey, Could somebody help me with my game im making? I have a Rocket that automatically aims at your mouse and when you click it moves forward, But i was wondering if there was a way to get the rocket to behave in a way so that when it is further away from your mouse, it moves quicker and gradually as it gets closer then it starts slowing down. Thanks in advance.
- ghernkhoo
- Scratcher
36 posts
List of Helpful Topics for Scripting
the cloud list thing is just when you press the green flag againcloud lists can store in their server
This is a signature
Not manually typed
When i post on the forum this shows below what i type
thank you
Roses are red,
Violets are blue.
Omae wa mou
Shindeiru
- asivi
- Scratcher
1000+ posts
List of Helpful Topics for Scripting
The below works fine for no complex texts, it extracts words from a text to a list:
It is in http://scratch.mit.edu/projects/143574353
when green flag clicked
ask [whatever] and wait
extact words from (answer) separator [ ] :: custom//in this case the separator is "space"
//except for the separator ^^^
//all white squares must contain nothing,
//even not an space or any other invisible character
define extact words from (string) separator (sep)
delete (all v) of [words v]
set [letter # v] to [0]
repeat (length of (string))
change [letter # v] by (1)
set [word v] to []
if <not <(letter (letter #) of (string)) = (sep)>> then
repeat until <<(letter (letter #) of (string)) = (sep)> or <(letter (letter #) of (string)) = []>>
set [word v] to (join (word) (letter (letter #) of (string)))
change [letter # v] by (1)
end
if <not <(word) = []>> then
add (word) to [words v]
end
end
end
It is in http://scratch.mit.edu/projects/143574353
- SecretGorilla89
- Scratcher
32 posts
List of Helpful Topics for Scripting
Yes finally something helpful this is a platformer script. hope you find it helpful.when green flag clicked
forever
change [ y] by (-0.5)
if <key [ right arrow] pressed?> then
change [ x] by (1)
end
if <key [ left arrow] pressed?> then
change [ x] by (-1)
end
set [ x] to ((x) * (0.9))
change x by (x)
if <touching color [black]?> then
change y by (1)
if <touching color [black]?> then
change y by (1)
if <touching color [black]?> then
change y by (1)
if <touching color [black]?> then
change y by (1)
if <touching color [black]?> then
change y by (1)
if <touching color [black]?> then
change y by (1)
if <touching color [black]?> then
change y by (-6)
if <key [up arrow] pressed?> then
set [y] to [10]
if <(x) < [0]> then
set [x] to [10]
end
if <not <(x) < [0]>> then
set [ x] to [-10]
end
end
if <not <key [up arrow] pressed?>> then
change x by ((x) * (-1))
set [x] to [0]
end
end
end
end
end
end
end
end
change y by (y)
if <touching color [black]?> then
change y by ((y) * (-1))
set [y] to [0]
end
change y by (-0.5)
if <<touching color [black]?> and <key [up arrow] pressed?>> then
set [y] to [10]
end
change y by (0.5)
end
How do i copy this directly without having to put in all the blocks myself?
- asivi
- Scratcher
1000+ posts
List of Helpful Topics for Scripting
It doesn't take too of your time, practice a bit at least. How do i copy this directly without having to put in all the blocks myself?
- coolawesomegirl2010
- Scratcher
22 posts
List of Helpful Topics for Scripting
play drum (6 v) for (0.25) beats
next costume
- duckboycool
- Scratcher
1000+ posts
List of Helpful Topics for Scripting
This topic is getting very spammy, I feel we should close this. Although we are still adding to it. Hmmm… what can you do?
Last edited by duckboycool (Feb. 18, 2017 02:23:02)
I used to be active on the forums, but I have mostly moved past Scratch. I still do check my Scratch messages, so if you'd like to talk to me, just leave a comment on my profile. My main project on Scratch was Cookie Clicker, but my newest project is Snake Snake, a game based off of Snake, but with two snakes, and you can play either singleplayer or multiplayer.
- 8302181391
- Scratcher
18 posts
List of Helpful Topics for Scripting
(Until) how do you create a block like that?
- asivi
- Scratcher
1000+ posts
List of Helpful Topics for Scripting
So, do you want to upload a project containig really big lists but no way?
try creating a custom block and create a text input and check to run without screen refresh, then go adding the argument you have pasted in the block as is needed for your pourpose.
An example, the scripts below are in https://scratch.mit.edu/projects/135420737/ it extract words separatedly from a really long text
try creating a custom block and create a text input and check to run without screen refresh, then go adding the argument you have pasted in the block as is needed for your pourpose.
An example, the scripts below are in https://scratch.mit.edu/projects/135420737/ it extract words separatedly from a really long text
Strip text [ ]//here i've pasted a text 836.906 characters long
define Strip text (txt)
hide list [Allowed char$ v]
hide list [Stripped txt v]
delete (all v) of [Stripped txt v]
set [letter# v] to [1]
repeat (length of (txt))
set [word match v] to []//this is totally empty even not an space
if <[Allowed char$ v] contains (letter (letter#) of (txt)) ?> then
repeat until <not <[Allowed char$ v] contains (letter (letter#) of (txt)) ?>>
set [word match v] to (join (word match) (letter (letter#) of (txt)))
change [letter# v] by (1)
end
add (word match) to [Stripped txt v]
else
change [letter# v] by (1)
end
end
show list [Allowed char$ v]
show list [Stripped txt v]