Newbie here.
I cannot get my animated character to jump, or at least correctly. I need my character to jump onto platforms. My character will either jump but not land on the platforms, or they just won't jump at all. I made my own script, but the character would just jump up and down. Also, it took up too much data. I've tried several examples given on this forum but none have worked for me so far. I have a feeling that the variables part of it will be involved so if anyone can take me step-by-step, that would be appreciated.
Offline
I haven't time to explain (got to go to school) but there are lots of good tutorials you can find.
Offline
werdna123 wrote:
I haven't time to explain (got to go to school) but there are lots of good tutorials you can find.
But I've tried a lot and none of them have worked out for me.
My script for jumping:
When Flag is clicked
forever
if touching color pink
change y by 0
else
change y by -8
I had more but I deleted it all sue to frustration.
Also I'm trying to make a coin randomly reappear after being caught and disappearing but I cannot get it to redo the command:
Script:
When Flag is clicked
forever
repeat until costume # of sprite 1=11
go to x: pick random (-200) to (210) y: 180
forever if touching color blue
switch to costume Coin
repeat 2
switch costume to costume1
wait .01 sec
switch costume to costume2
wait .01 sec
switch costume to costume3
wait .01 sec
switch costume to costume4
wait .01 sec
switch costume to costume5
wait .01 sec
switch costume to costume6
wait .01 sec
switch costume to Coin
wait .01 sec
If touching color pink
change y by 0
else
change y by -8
If touching sprite 1
change ghost effect by 1000
Help please.
Offline
Make it more than 0. Simple.
Offline
When Flag is clicked
forever
if touching color pink
change y by 0
else
change y by -8
that won't work. try
When Green Flag Pressed
Forever
If <touching color [pink]?>
Change Y by 5
If <not <touching color [pink]?>
Change Y by -5
I don't know why, but it works. Hope this helps
Last edited by OldWheezerGeezer (2011-01-27 17:26:04)
Offline
If pink is your floor color:
When Green Flag Pressed
for
{
if up key pressed AND touching pink
{
repeat (10) times
{
change Y by (6)
}
}
if NOT touching pink
{
change Y by (-1)
}
}
}
That should work
Offline
Thanks for the help guys! While messing with the program I found a much easier way to do it. My character sort of defies the law of gravity when using the up arrow, but at least he can jump from place to place.
Does anyone know how to repeat a script though?
Offline
You repeat a script with <forever> or <forever if>
I prefer the <forever if> script better versus <forever> .
It works better and allows you to minimize the amount of scripts you have, but sometimes, <forever> works, too.
Hope this helps, and good luck with your platform! Tell me when it's ready!
Offline