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

#1 2012-09-17 17:34:16

tbfg32
Scratcher
Registered: 2012-02-13
Posts: 35

Help, please.

Well, I am trying to make a portal platformer, but I can't figure out this one thing: Well, I have my person, with it's movement script, and the portals and a way to put them out, but I can't figure out a way to make the person go from one to the other portal, without getting stuck in an endless loop. See, if you go like:

when gf clicked
forever
wait until < (touching) > [blue] >
go to [orange v]
end 
Actually the touching thing is the touching sensing block with the sprite "Blue" as in blue portal there. but I couldn't get that... Orange is the orange portal. But anyways, if you do that, your person gets stuck in an endless loop of staying in one spot and not beig able to move, because of that script, and another one like it, but with all blues replaced with orange, and all oranges replaced with blues. So when you enter one portal, you can't move in or out because both scripts are acting against eachother so fast. I know this is a bi confusing, but can anyone help me?

Offline

 

#2 2012-09-17 17:38:03

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

Re: Help, please.

when gf clicked
forever
if <touching [blue v]?>
go to [yellow v]
wait until <not <touching [yellow v]?>>
end
and vice versa, each in a seperate script.

Last edited by Firedrake969 (2012-09-17 17:38:22)


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

Offline

 

#3 2012-09-17 19:41:05

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: Help, please.

Firedrake969 wrote:

when gf clicked
forever
if <touching [blue v]?>
go to [yellow v]
wait until <not <touching [yellow v]?>>
end
and vice versa, each in a seperate script.

this should work, but just remember that the most important part of portal is "speedy thing goes in, speedy thing comes out"

Offline

 

#4 2012-09-17 21:45:44

Molybdenum
Scratcher
Registered: 2012-06-17
Posts: 1000+

Re: Help, please.

kayybee wrote:

Firedrake969 wrote:

when gf clicked
forever
if <touching [blue v]?>
go to [yellow v]
wait until <not <touching [yellow v]?>>
end
and vice versa, each in a seperate script.

this should work, but just remember that the most important part of portal is "speedy thing goes in, speedy thing comes out"

I thought the most important part was that the cake is a lie..


"The Enrichment Center is required to remind you that you will be baked, and then there will be cake."
(|Balls and Platforms: Stay on!|) (|NaOS-H: An operating system... Or is it?|)

Offline

 

#5 2012-09-18 19:53:14

tbfg32
Scratcher
Registered: 2012-02-13
Posts: 35

Re: Help, please.

kayybee wrote:

Firedrake969 wrote:

when gf clicked
forever
if <touching [blue v]?>
go to [yellow v]
wait until <not <touching [yellow v]?>>
end
and vice versa, each in a seperate script.

this should work, but just remember that the most important part of portal is "speedy thing goes in, speedy thing comes out"

Yea, that's the problem I might have... And the part that you can put a portal ANYWHERE on the screen. Now, how do I fix THAT?

Offline

 

#6 2012-09-18 19:54:21

tbfg32
Scratcher
Registered: 2012-02-13
Posts: 35

Re: Help, please.

Firedrake969 wrote:

when gf clicked
forever
if <touching [blue v]?>
go to [yellow v]
wait until <not <touching [yellow v]?>>
end
and vice versa, each in a seperate script.

Thank you so much! This will really help!

Offline

 

#7 2012-09-18 19:57:49

tbfg32
Scratcher
Registered: 2012-02-13
Posts: 35

Re: Help, please.

Firedrake969 wrote:

when gf clicked
forever
if <touching [blue v]?>
go to [yellow v]
wait until <not <touching [yellow v]?>>
end
and vice versa, each in a seperate script.

I tried it, but instead of being stuck, the player flickered really fast inbetween each one, and you had to move the portal at the right time to get where you wanted, What can I do about that?

Offline

 

#8 2012-09-18 20:00:38

bullelk12
Scratcher
Registered: 2012-05-26
Posts: 100+

Re: Help, please.

Oh I see. That script would create an infinite loop. Let me see.


http://mag.racked.eu/cimage/i6000/Achievement++get%21/Scratcher+love+minecraft%21/mca.png

Offline

 

#9 2012-09-18 20:10:44

bullelk12
Scratcher
Registered: 2012-05-26
Posts: 100+

Re: Help, please.

I figured out a way to break the endless loop! You have to do it in a single script like this:

when gf clicked 
forever 
if <touching [blue v]?>
go to [yellow v]
wait until <not <touching [yellow v]?>>
end
if <touching [yellow v]?>
go to [blue v]
wait until <not <touching [blue v]?>>


http://mag.racked.eu/cimage/i6000/Achievement++get%21/Scratcher+love+minecraft%21/mca.png

Offline

 

Board footer