So, i am making a game were you have to find clues and move around and i am stuck on one little problem. I can make my character move left and right by going...
When lefft arrow klicked
move -10 steps
(and)
When right arrow klicked
move 10 steps
but... i dont know how to make my character move up down and diagonal, if you could tell me how to do that it would be apreciated, especially diagonals
Thanks -canadiandufus
Offline
i can help you :
when [upp arrow] clicked change y by (10)and -10 y (down)
when [right key] clicked change x by (10)and do x-10 (left)
Last edited by kattenelvis (2013-04-23 12:43:29)
Offline
i would do what kattenelvis said. for diagonal, do a combination. for example: up left could be
change x by [-10] change y by [10]at the top of the "Help with Scripts" forum page, there is a sticky topic "list of helpful topics for scripting", that would probably be of interest to you.
Offline
kattenelvis wrote:
i can help you :
when [upp arrow] clicked change y by (10)and -10 y (down)
you can do:when [right key] clicked change x by (10)and do x-10 (left)
hope it helped because your new do stage-->backgrounds--->import and get the x-y grid for help
hope it helped
or for more smooth moving:
when gf clicked forever if <key [right control key v] pressed?> change x by (2)
when gf clicked forever if <key [left control key v] pressed?> change x by (-2)
when gf clicked forever if <key [up control key v] pressed?> change y by (2)
when gf clicked forever if <key [down control key v] pressed?> change y by (-2)This way, no need to do diagonal moving! it does it on it's own!
when gf clicked forever if <key [up control key v] pressed?> change [yvel v] by (2)
when gf clicked forever if <key [down control key v] pressed?> change [yvel v] by (-2)
when gf clicked forever if <key [right control key v] pressed?> change [xvel v] by (2)
when gf clicked forever if <key [left control key v] pressed?> change [xvel v] by (-2)and the last script
when gf clicked forever set [xvel v] to ((xvel) * (0.98) set [yvel v] to ((yvel) * (0.98) change y by (yvel) change x by (xvel)And that is for smooth moving! hope this also helps
Offline