Here are some scripts to use in your projects! Reply with more if you can!
To make a good platformer, I suggest doing this for jumping (I think) (I'll add moving around later):
when gf clicked forever if <touching color [#000000]?> repeat until <key [up arrow v] pressed?> set [yvel v] to (0) end else repeat until <touching color [#000000]?> change [yvel v] by (-0.3) end end end when gf clicked forever if <key [up arrow v] pressed?> if <touching color [#000000]?> repeat (14) change [yvel v] by (0.5) else change [yvel v] by (-0.6) end change y by (yvel) endHere is a script that selects something random to do:
set [random v] to (pick random (1) to (however many different possible actions there are)) if <(random) = [1]> first script end if <(random) = [2]> second script end etc.
Last edited by awesomeness321 (2012-10-19 15:57:38)
Offline
Well, if you add that to a platformer, you should have a
change y by (yvel)so that it actually does something.
if <(pick random (1) to (2)) = [1]> do script else do other script endif it's between a number of scripts (that's more than 2):
set [random# v] to <pick random (1) to (3)> //the 3 can be replaced with any number if <(random#)=[1]> script end if <(random#)=[2]> other script end if <(random#)=[3]> another script end //repeat this process for however many scripts you have.
Offline
TorbyFork234 wrote:
Well, if you add that to a platformer, you should have a
change y by (yvel)so that it actually does something.
For the something random to do, if it's between 2 scripts:if <(pick random (1) to (2)) = [1]> do script else do other script endif it's between a number of scripts (that's more than 2):set [random# v] to <pick random (1) to (3)> //the 3 can be replaced with any number if <(random#)=[1]> script end if <(random#)=[2]> other script end if <(random#)=[3]> another script end //repeat this process for however many scripts you have.
For the first one, I know, but I forgot.
EDIT: There, it's there now.
For the second one, that was what I was going to put!
Last edited by awesomeness321 (2012-10-17 16:33:10)
Offline
I have a game called jump, I need to make the rabbit not just float in the air until you let go of the up button, I'd like to do gravity... you can download the game and post it in the comments, please!
Offline
awesomeness321 wrote:
Here are some scripts to use in your projects! Reply with more if you can!
To make a good platformer, I suggest doing this for jumping (I think) (I'll add moving around later):when gf clicked forever if <touching color [#000000]?> set [yvel v] to (0) else repeat until <touching color [#000000]?> change [yvel v] by (-0.5) end end if <key [up arrow v] pressed?> if <touching color [#000000]?> repeat (15) change [yvel v] by (0.5) end set [yvel v] to [0] repeat (15) change [yvel v] by (-0.5) end set [yvel v] to [0] end set [yvel v] to [0] else change [yvel v] by (-0.6) end change y by (yvel) endHere is a script that selects something random to do:set [random v] to (pick random (1) to (however many different possible actions there are)) if <(random) = [1]> first script end if <(random) = [2]> second script end etc.
HOw many times do we have to say this. The jump part makes the cat accelerate upwards, suddenly stop, and start fall downwards, and suddenly stop.
Last edited by Molybdenum (2012-10-18 21:42:42)
Offline
Molybdenum wrote:
awesomeness321 wrote:
Here are some scripts to use in your projects! Reply with more if you can!
To make a good platformer, I suggest doing this for jumping (I think) (I'll add moving around later):when gf clicked forever if <touching color [#000000]?> set [yvel v] to (0) else repeat until <touching color [#000000]?> change [yvel v] by (-0.5) end end if <key [up arrow v] pressed?> if <touching color [#000000]?> repeat (15) change [yvel v] by (0.5) end set [yvel v] to [0] repeat (15) change [yvel v] by (-0.5) end set [yvel v] to [0] end set [yvel v] to [0] else change [yvel v] by (-0.6) end change y by (yvel) endHere is a script that selects something random to do:set [random v] to (pick random (1) to (however many different possible actions there are)) if <(random) = [1]> first script end if <(random) = [2]> second script end etc.HOw many times do we have to say this. The jump part makes the cat accelerate upwards, suddenly stop, and start fall downwards, and suddenly stop.
I changed the script. It should work now.
Last edited by awesomeness321 (2012-10-19 16:05:05)
Offline
awesomeness321 wrote:
Molybdenum wrote:
awesomeness321 wrote:
Here are some scripts to use in your projects! Reply with more if you can!
To make a good platformer, I suggest doing this for jumping (I think) (I'll add moving around later):when gf clicked forever if <touching color [#000000]?> set [yvel v] to (0) else repeat until <touching color [#000000]?> change [yvel v] by (-0.5) end end if <key [up arrow v] pressed?> if <touching color [#000000]?> repeat (15) change [yvel v] by (0.5) end set [yvel v] to [0] repeat (15) change [yvel v] by (-0.5) end set [yvel v] to [0] end set [yvel v] to [0] else change [yvel v] by (-0.6) end change y by (yvel) endHere is a script that selects something random to do:set [random v] to (pick random (1) to (however many different possible actions there are)) if <(random) = [1]> first script end if <(random) = [2]> second script end etc.HOw many times do we have to say this. The jump part makes the cat accelerate upwards, suddenly stop, and start fall downwards, and suddenly stop.
I changed the script. It should work now.
Still doesn't work.
when gf clicked forever if <touching color [#000000]?> set [yv v] to [0] if <key [up arrow v] pressed?> set [yv v] to [5] end else change [yv v] by (-.5) end end
Last edited by Molybdenum (2012-10-19 16:09:29)
Offline