Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » What is the script
- BadGorrila
- New to Scratch
2 posts
What is the script
What is the script for a game where for example you're hanging on a wall and you shoot a bullet to the wall to fly back to achieve the objective. For example https://youtu.be/eIBrRZMYr6w?t=19
- MookyE
- Scratcher
100+ posts
What is the script
I would use x and y velocity variables (for this sprite only) and reverse them when hitting a wall
Hi!
- MrCreeper_From_MC
- Scratcher
58 posts
What is the script
project link: https://scratch.mit.edu/projects/618049365/ click in side to see code for it
Last edited by MrCreeper_From_MC (Dec. 17, 2021 13:34:14)
I lik cake it so yumy yum yum yum yum cake so yumy eat it all day yum yum yum
when green flag clicked
forever
like (cak v) (because v) its (yumy v) for (3) (years v)
if <not<[alt] = [ek43680]>> then
set [alt v] to [ek43680]
else
lik (cak)
end
end
- BadGorrila
- New to Scratch
2 posts
What is the script
Can you be more specific @MookyE How to make variables actually edit the velocity or how can you reverse them
Last edited by BadGorrila (Dec. 17, 2021 04:51:25)
- MrCreeper_From_MC
- Scratcher
58 posts
What is the script
Can you be more specific @MookyE How to make variables actually edit the velocity or how can you reverse them
you would do this to reverse velocity:
when I receive [velocity reverse v]
set [velocity v] to (join [-] (velocity))
Last edited by MrCreeper_From_MC (Dec. 17, 2021 13:30:20)
I lik cake it so yumy yum yum yum yum cake so yumy eat it all day yum yum yum
when green flag clicked
forever
like (cak v) (because v) its (yumy v) for (3) (years v)
if <not<[alt] = [ek43680]>> then
set [alt v] to [ek43680]
else
lik (cak)
end
end
- deck26
- Scratcher
1000+ posts
What is the script
Much better to subtract from 0 or multiply by -1. Using that method with a number that is already negative will just double the ‘-’ and end up with a text string.Can you be more specific @MookyE How to make variables actually edit the velocity or how can you reverse them
you would do this to reverse velocity:when I receive [velocity reverse v]
set [velocity v] to (join [-] (velocity))
Try setting a variable to -5, then set it to join ‘-’ itself and finally multiply by 1. You think you're going to get 5 but you won't.
- Discussion Forums
- » Help with Scripts
- » What is the script