Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Simple rock climbing game - Help please!
- Foxzes
-
23 posts
Simple rock climbing game - Help please!
https://scratch.mit.edu/projects/203251855/#player
I'm trying to get it so when the rock (X) is clicked, the climber will climb towards it.
I've only set up the Y movements so far, and I can't seem to find a way to get it to go to X without that silly bouncing thing.
To test it, just drag the X somewhere and click it, the rock climber will climb towards it but then bounce once he's there.
If you think you can get it to work nicely, so the climber will climb to the X properly, please remix!
Thanks!
I'm trying to get it so when the rock (X) is clicked, the climber will climb towards it.
I've only set up the Y movements so far, and I can't seem to find a way to get it to go to X without that silly bouncing thing.
To test it, just drag the X somewhere and click it, the rock climber will climb towards it but then bounce once he's there.
If you think you can get it to work nicely, so the climber will climb to the X properly, please remix!
Thanks!
- cbletson
-
27 posts
Simple rock climbing game - Help please!
I think its because you have the x vakue change stuck in a loob
when green flag clicked
forever
if <[xx/yy] > [x/y]> then
repeat until <[x/y] > [xx/yy]>
change [xx/yy] by (4)
end
end
if <[xx/yy] < [x/y]> then
repeat until <[x/y] < [xx/yy]>
change [xx/yy] by (-4)
end
- hammer965
-
100+ posts
Simple rock climbing game - Help please!
I would suggest the following scripts:
On the rock sprite
On the climber sprite
On the rock sprite
when this sprite clicked
set [ x] to (x position)
set [ y] to (y position)
broadcast [ rock clicked]
On the climber sprite
when I receive [ rock clicked]
glide (2) secs to x: (x) y: (y)
- Foxzes
-
23 posts
Simple rock climbing game - Help please!
Okay I fixed it, I over complicated it but I think its necessary for what I'm trying to achieve
Anyone know if its possible to make it reach the X axis at the same time as the Y axis, without being too complicated? I want the climber to effectively jump to the X, and the way it moves currently it may move X and Y at the same time, but when one is bigger than the other it just does a very unnatural dead straight to the X.
Thanks!
Anyone know if its possible to make it reach the X axis at the same time as the Y axis, without being too complicated? I want the climber to effectively jump to the X, and the way it moves currently it may move X and Y at the same time, but when one is bigger than the other it just does a very unnatural dead straight to the X.
Thanks!
- bennettcstrand
-
1 post
Simple rock climbing game - Help please!
idk
Last edited by bennettcstrand (Jan. 28, 2021 20:00:16)
- Discussion Forums
- » Help with Scripts
-
» Simple rock climbing game - Help please!