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

#1 2012-08-01 12:35:40

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Moving platform

In my platformer, I want to have a moving platform, but the character won't stay on the platform...

Last edited by Firedrake969 (2012-08-01 12:58:34)


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#2 2012-08-01 12:41:37

wasabi56
Scratcher
Registered: 2012-02-10
Posts: 500+

Re: Moving platform

forever
repeat until<(y position)=[anything]>
change y by (2)
end
repeat until <(y position)=[anything]>
change y by (-2)
end
would this not work  hmm

Last edited by wasabi56 (2012-08-01 12:47:26)


http://i.picasion.com/pic58/c23d4d2fc75f459dcf3d9ebf3e8ba395.gif
http://www.weebly.com/uploads/1/0/1/4/10146167/2294523_orig.png

Offline

 

#3 2012-08-01 12:43:54

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: Moving platform

wasabi56 wrote:

forever
repeat until(( y position)=(anything))

Download it...


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#4 2012-08-01 12:56:40

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Moving platform

Try using this in your platform:

when gf clicked
forever
 if < (seeing platform?) = true >
  go to x: (-12) y: (20)
  glide (2) secs to x: (-12) y: (80)
  wait (0.03) secs
  glide (2) secs to x: (-12) y: (20)
  wait (0.03) secs
 end

when gf clicked
forever
 if < (seeing platform?) = true >
  show
 else
  hide
 end
Remember that the positions in the (glide to x = ( ) y = ( ) ) can be changed, as well as the positions in the (go to x = ( ) y = ( ) ).

Last edited by ErnieParke (2012-08-01 13:08:53)


http://i46.tinypic.com/35ismmc.png

Offline

 

#5 2012-08-01 12:57:31

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Moving platform

You could use trig to make a moving platform.

forever
go to x:(platform X) y:((([sin v] of (theta)) * (movement height)) + (playform y))
change [theta v] by (1)
the variable (movement height), when set to 20, woumd mean the platform has a movement range of (platform y) +- 20

Last edited by Wes64 (2012-08-01 12:58:12)


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#6 2012-08-01 13:31:35

Borrego6165
Scratcher
Registered: 2011-03-10
Posts: 1000+

Re: Moving platform

very simple... make sure the image cannot rotate itself. IF direction = 90 (right) change scroll x (or just x position) by 3 (replace with speed) IF direction = -90 (left) change scroll x (or just x position) by -3 (replace with speed)

oh, and make sure it only does this when touching, and when you want it to move in a direction you add the rotation blocks. NO SIN NEEDED, OR COMPLICATED VARIABLES, OR WEIRD BLOCKS! AND THEY CAN GET OFF AT ANY TIME!

If you need any more help ask me on the Mist forums, and I will share with you everything I learnt on Rayman 4 from slippery rollers to elevators that disappear or turn upside-down so the player gets pushed off them.

Last edited by Borrego6165 (2012-08-01 13:33:57)


Generation:4001 Build a beautiful city, with over 50 objects and over 10000 tiles per city! This simulates traffic, pollution, tourism, crime and more!

Offline

 

#7 2012-08-01 15:01:39

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: Moving platform

Borrego6165 wrote:

very simple... make sure the image cannot rotate itself. IF direction = 90 (right) change scroll x (or just x position) by 3 (replace with speed) IF direction = -90 (left) change scroll x (or just x position) by -3 (replace with speed)

oh, and make sure it only does this when touching, and when you want it to move in a direction you add the rotation blocks. NO SIN NEEDED, OR COMPLICATED VARIABLES, OR WEIRD BLOCKS! AND THEY CAN GET OFF AT ANY TIME!

If you need any more help ask me on the Mist forums, and I will share with you everything I learnt on Rayman 4 from slippery rollers to elevators that disappear or turn upside-down so the player gets pushed off them.

Go to the forums to talk there.


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#8 2012-08-01 15:30:20

zubblewu
Scratcher
Registered: 2011-02-17
Posts: 1000+

Re: Moving platform

You used my old platformer base, right? The new one has slopes and moving platform support and walljump (easy to disable) http://scratch.mit.edu/projects/zubblewu/2703276

Last edited by zubblewu (2012-08-01 15:30:30)


........................................................................................................................................................................................................................................

Offline

 

#9 2012-08-02 11:19:43

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: Moving platform

Can you write the script here, or not?


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#10 2012-08-02 13:39:45

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Moving platform

Closed by request of the topic owner.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

Board footer