Change scene size when specific rule is true

goo_189goo_189 Member Posts: 4
edited September 2015 in Working with GS (Mac)

Hi guys, I am new to GS. Been learning GS for these pass few days.

I have got a question, is it possible to change the scene size when specific rule is true?

Basically, my thought is that, when my actor reaches to x=> 200, scene size will change from scene size width to scene size width +500. Or after every 1 sec of runtime, scene size will change from scene size width to scene size width +500.

The idea is to create an endless runner that will basically spawn random platform and also have an infinite scene.

I tried it, but did not work. I would like to know did I do something wrong or it is just not possible.

P/S: I have watched Jamie's tutorial, however, both tutorial does not really show what I wanted to create. As for the platform running towards player tutorial, i found that if the player hit the platform, the platform will move; as for the player running towards platform tutorial, we had to manually made the level; which means this level will end somewhere because we still have to set the scene width.

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    @goo_189 said:
    I have got a question, is it possible to change the scene size when specific rule is true?

    Yes, you can trigger a rule with pretty much anything.

    @goo_189 said:
    Basically, my thought is that, when my actor reaches to x=> 200, scene size will change from scene size width to scene size width +500.

    What would that look like to the player ?

    @goo_189 said:
    Or after every 1 sec of runtime, scene size will change from scene size width to scene size width +500.

    Triggering something after 1 second of runtime is simple enough (Rule --When game.time > 1) . . . but what would it look like to a player for the scene size to change ?

    @goo_189 said:
    I tried it, but did not work. I would like to know did I do something wrong or it is just not possible.

    I was trying to add up two numbers, I added them up but they didn't give me the result I was expecting, did I do something wrong or it is just not possible ?

    :tongue:

  • goo_189goo_189 Member Posts: 4
    edited September 2015

    @Socks said:
    :tongue:

    Hi Socks, perhaps my description is a little bit confusing. I will rephrase it.

    What I am trying to say is, can I set, when Actor 1 reaches certain point of the screen, let's say X, scene size width will add 500 in addition to the current scene size; and as long as Actor 1 kept staying at X, the scene size will just keep on expanding.

    I just tested by using display text function, the number for scene size width is changing, but I did not see the scene width expanding. The scene will still end at some point.

  • SocksSocks London, UK.Member Posts: 12,822

    @goo_189 said:
    What I am trying to say is, can I set, when Actor 1 reaches certain point of the screen, let's say X, scene size width will add 500 in addition to the current scene size; and as long as Actor 1 kept staying at X, the scene size will just keep on expanding.

    What would that look like to the player ?

  • goo_189goo_189 Member Posts: 4

    @Socks said:

    Ah, so,
    Actor 1 will start going to the right from left, until he reached certain point, X (middle of the screen), then the camera will start to follow him. On that point, Actor 1 will just kept staying at X (But actually he is still moving with linear velocity x, only now the camera is following him.)

  • SocksSocks London, UK.Member Posts: 12,822

    @goo_189 said:
    . . . 'Actor 1 will just kept staying at X' . . .

    If the actor stays at 'X' - then why would you need to chance the scene size ?

    (apologies if I don't understand).

  • goo_189goo_189 Member Posts: 4

    @Socks said:
    (apologies if I don't understand).

    Hmmm, how do I put this, although visually the actor stays at X, but he is actually moving. The reason he stays at X although he is moving is because the camera is tracking him.

    So, I need a wider scene width to accumulate the movement.

    Anyway, I figured a workaround is to just preset the scene width to a very very large number. But I still would like to know if the method I tried above will work or not.

  • RowdyPantsRowdyPants Member Posts: 465

    @goo_189 Yes, you can increase the scene size but in your case don't. Either start with a full (complete/wide) scene or just think of it differently.

    Instead of a forever growing scene with a character moving through it create a never changing scene with obstacles/terrain spawning off screen and moving across the non moving scene. The character is in the middle-ish somewhere jumping/flying/whatever and although it looks like it's moving it's actually the rest of the level that is being dynamically generated and moved across the screen without ever messing with the scene size.

  • shooter93shooter93 Member Posts: 10

    I have a question looking a bit like this OP.
    please take a look at it here: http://forums.gamesalad.com/discussion/92805/need-help-with-scene-issue-i-just-cant-figure-it-out/p1?new=1
    help would be deeply appriciated

Sign In or Register to comment.