I am making a game with the main character as a ball. I want it to be able to roll up slopes, not just stop when it hits one. Whenever I try to go up a slope though, the ball goes right through it. Does anybody know how to fix this?
bleucheese
Offline
Yes.
The most simple way of doing it is like this:
_________________________________
When the green flag is pressed
[Forever if Touching colour (colour of the ground)]
[Change y by 1]
___________________________________________________
Offline
This is really hard to do.
I suggest you use erkstock's sensor.
Offline
Use a script that does this: Forever, sense whether it is touch a slope. Repeat until not touch a slope: change y by 1. Then use gravity.
Offline
I tried the change y by 1 script that bobbybee and CoolGamesCY suggested, and it does not go through the slope anymore, but it just goes straight to the top of the slope now. Any Ideas?
Offline
bleucheese wrote:
I tried the change y by 1 script that bobbybee and CoolGamesCY suggested, and it does not go through the slope anymore, but it just goes straight to the top of the slope now. Any Ideas?
try adding a change x by 1 straight after. if that doesn't work you'll need a more complicated script
Offline
This is the script i am using:
when gf clicked forever if<key [right arrow v] pressed?> change [x velocity v] by (-0.3) if<key [left arrow v] pressed?> change [x velocity v] by (0.3) if<touching [ground v]?> set [y velocity v] to (2) if <key [up arrow v] pressed?> set [y velocity v] to (18) if <[up slope] = [yes]> change [x velocity v] by (0.3) change y by [1] if<[down slope] = [yes]> change [x velocity v] by (0.3) change y by [1] set [x velocity v] to ((x velocity) * [0.97]) change [x scroll v] by (x velocity) change [y velocity v] by [-1] change y by (y velocity) turn ccw (x velocity) degreesI didnt mean to put all those ifs together.
Last edited by bleucheese (2012-03-10 17:21:29)
Offline
Yeah, you need to do a check for gravity so it can go down the slope.
Offline
What do you mean a check for gravity?
Offline