So, I'm trying to make a platformer. I'm trying to make it so that I can use just one color to switch to multiple different levels. Here's my current scripts for portals/level-changing:
(Sprite's script)
when flag clicked forever if <touching color white> broadcast level1(Stage's script)
when i receive level 1 switch to background background 2However, this script only lets the game only have one level, as if i made the script for Sprite 3 somewhat like this:
if <touching color white> broadcast level1\ broadcast level2It would just change to level 2, right?
Offline
Wifflekipter wrote:
So, I'm trying to make a platformer. I'm trying to make it so that I can use just one color to switch to multiple different levels. Here's my current scripts for portals/level-changing:
(Sprite's script)when flag clicked forever if <touching color [#FFFFFF]?> broadcast level1 end(Stage's script)when i receive [level 1 v] switch to background [background 2 v]However, this script only lets the game only have one level, as if i made the script for Sprite 3 somewhat like this:if <touching color [#FFFFFF]?> broadcast [level1 v] broadcast [level2 v] endIt would just change to level 2, right?
I know that you could make multiple sprites to change the levels, but the last time I used that, I somehow screwed something up, and then the whole game was broken (skipping levels, spawning in the wrong place, etc.). So I'd rather not have that happen.
If anyone can help, please reply.
Fixed; anyway, I'll be back with an answer tomorrow.
With regards,
ErnieParke
Last edited by ErnieParke (2013-03-26 22:38:59)
Offline
Thanks.
Offline
Right, I'll try that, but what's BG?
Offline
Never mind, I figured out what BG means.
Offline
@7734f: It means background.
@xlk: I don't understand, do you mean:
when gf clicked switch to background [level1] forever if <touching color etc.> switch to background [level2] endOr do you just do the exact thing shown here?
Offline
@xlk uses a variable called level. When the level changes, you increase the level by 1, and when level =1, set the background to level 1's background, etc.
Offline
Wifflekipter wrote:
@7734f: It means background.
@xlk: I don't understand, do you mean:when gf clicked switch to background [level1] forever if <touching color etc.> switch to background [level2] endOr do you just do the exact thing shown here?
When the sprite touches the color
forever if <touching color [#00FF00]>//or your color end endThen it sends out a message:
forever if <touching color [#00FF00]> broadcast [next level v] end endThe stage receives the message:
When I receive [next level v]And then changes it's background:
When I receive [next level v] next backgroundDoes that make sense?
Last edited by 7734f (2013-03-27 14:57:29)
Offline
7734f wrote:
Wifflekipter wrote:
@7734f: It means background.
@xlk: I don't understand, do you mean:when gf clicked switch to background [level1] forever if <touching color [#FFFFFF]?> switch to background [level2 v] endOr do you just do the exact thing shown here?When the sprite touches the color:
forever if <touching color [#00FF00]?> broadcast [next level v] wait until <not (touching color [#FFFFFF]?)>//Added endThe stage receives the message:When I receive [next level v]And then changes it's background:When I receive [next level v] next backgroundDoes that make sense?
The sprite that is touching the color broadcasts a message, the stage receives the message, and goes to the next background.
Hope that helped!
~7734f
Fixed, and you're probably going to want a [wait until <not (touching color[color]?)>] block as well to prevent skipping over multiple levels.
With regards,
ErnieParke
Offline
I'll try, thanks guys..
Offline