This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-01-27 03:11:52

twiddledee
New Scratcher
Registered: 2011-01-27
Posts: 3

Please help me...

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.  smile

Offline

 

#2 2011-01-27 03:14:56

werdna123
Scratcher
Registered: 2010-06-12
Posts: 1000+

Re: Please help me...

I haven't time to explain (got to go to school) but there are lots of good tutorials you can find.  smile

Offline

 

#3 2011-01-27 13:02:51

twiddledee
New Scratcher
Registered: 2011-01-27
Posts: 3

Re: Please help me...

werdna123 wrote:

I haven't time to explain (got to go to school) but there are lots of good tutorials you can find.  smile

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

 

#4 2011-01-27 13:32:28

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Please help me...

Make it more than 0. Simple.

Offline

 

#5 2011-01-27 17:25:36

OldWheezerGeezer
Scratcher
Registered: 2010-06-04
Posts: 500+

Re: Please help me...

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  big_smile

Last edited by OldWheezerGeezer (2011-01-27 17:26:04)

Offline

 

#6 2011-01-27 17:41:26

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Please help me...

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  wink


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#7 2011-01-27 21:04:37

twiddledee
New Scratcher
Registered: 2011-01-27
Posts: 3

Re: Please help me...

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.  big_smile

Does anyone know how to repeat a script though?

Offline

 

#8 2011-01-27 21:50:19

Earthboundjeff
Scratcher
Registered: 2010-09-28
Posts: 1000+

Re: Please help me...

<forever>
<end>

Last edited by Earthboundjeff (2011-01-27 21:50:31)


https://encrypted-tbn0.google.com/images?q=tbn:ANd9GcR1SONrHUmdKZXQNDgtN_vpycOOo-BDMfnlqHZRA1lMpYXhX7Jc

Offline

 

#9 2011-02-03 18:48:56

kingofdallamas
Scratcher
Registered: 2010-03-07
Posts: 500+

Re: Please help me...

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.  big_smile

Hope this helps, and good luck with your platform! Tell me when it's ready!


http://i853.photobucket.com/albums/ab99/Gilgamesh1192/Ninja%20Saga/ElementalJutsus2.gifhttp://i27.photobucket.com/albums/c192/BoomKaTish/GIF/thgfhgfhfhgf.gif
ハロー友だち!

Offline

 

Board footer