I'm helping a friend make a Marble game. You know, like that Marble Racer, only with a Super Monkey ball twist. Anyway, I was wondering how you could make collision to a color if the x and y velocity gets changed by 0.1 when arrow keys are pressed.
Offline
If all your angles are 90 degrees:
when gf clicked set [x-vel v] to (0) set [y-vel v] to (0) forever if<key [up arrow v] pressed?> change [y-vel v] by (0.1) end if<key [down arrow v] pressed?> change [y-vel v] by (-0.1) end if<key [right arrow v] pressed?> change [x-vel v] by (0.1) end if<key [left arrow v] pressed?> change [x-vel v] by (-0.1) end change x by (x-vel) if<touching [color]?> set [x-vel v] to ((-1)*(x-vel)) change x by (x-vel) end change y by (y-vel) if<touching [color]?> set [y-vel v] to ((-1)*(y-vel)) change y by (y-vel) end
Offline
On collision, make your velocity a negative, than move it. Than set it to 0.
Offline
I made a project that should help you. Just read the notes and do as they say. It can be found here. Good luck with your project.
Offline