How do I use the Zone Scoll tutorial to achieve this effect?

Get help using Construct 2

Post » Thu Mar 16, 2017 1:53 pm

Hi there, our little game is using this fantastic capx provided a while ago ...

https://www.scirra.com/tutorials/747/zo ... a-movement

However, what we would really like to happen is for the game to 'pause' briefly after the zone scroll has completed so the player can see the new zone and react to dangers etc. Something similar to this ...

https://youtu.be/EqEy7BB5DNk?t=2m55s

Many, many thanks!
B
10
S
3
Posts: 50
Reputation: 800

Post » Fri Mar 17, 2017 11:58 am

Personally, this seems a little clunky to me. Rather than checking for an overlap, processes like this is done cheaper with 'Pick nearest'. Create a bunch of Zone markers just as you would in the other example. Every tick, find the nearest one and perform the same scrolling action. As a sub-event, use the following action. It checks if scrollx / y are within a margin (in this case 1) of their target. If they are, it pauses the game, waits a specified period of time (in this case 2 seconds), and then un-pauses the game.

Zone.X - 1 < ScrollX < Zone.X + 1
Zone.Y - 1 < ScrollY < Zone.Y + 1
Trigger once while true
|-> System > Set time scale to 0
|-> System > Wait 2 seconds
|-> System > Set time scale to 1
The LEVEL GENERATOR TOOLKIT



24 functions dedicated to producing randomly generated terrain for all kinds of games.
B
25
S
7
Posts: 237
Reputation: 2,296

Post » Fri Mar 17, 2017 2:24 pm

Hi there, thank you ever so much for replying @mrtumbles !

I have set the first part of the event to the following ...

Image

However this scrolls to the nearest room, not the room the player is in. Have I done this correctly?

Is there any chance you could provide a capx to show me properly (forgive my stupidity!)
B
10
S
3
Posts: 50
Reputation: 800

Post » Fri Mar 17, 2017 3:43 pm

It just needs to be

lerp( scrollx, Room.X, dt * n )

Where 'n' is the scrolling speed. Sorry, didn't notice the mess that expression was in. NB the origin point of your room should be the center for this to work correctly.

( As a side-Q: how is it possible that the nearest room to the player isn't the room with the player in it? )
The LEVEL GENERATOR TOOLKIT



24 functions dedicated to producing randomly generated terrain for all kinds of games.
B
25
S
7
Posts: 237
Reputation: 2,296

Post » Fri Mar 17, 2017 3:48 pm

Ah, this works - the issue here though is that rooms that are larger than the screen size.

Using the camera zone method previously outlined, it bound the camera to the player when in a larger room. This now scrolls to that room but doesn't follow the player's movements within a room that is larger than the screen size.
B
10
S
3
Posts: 50
Reputation: 800

Post » Fri Mar 17, 2017 11:24 pm

The pause.

https://www.dropbox.com/s/kkq9rsnx1o5af ... .capx?dl=0

Adjust the timing to your liking.
Adjust the lerp so the player is able to move more into view.

Place the events that move monsters in the right group. Each group holds events for that room.
Monsters in other rooms where the player is not, will go on non active / wait for the player to see them, i know that.
Use a Boolean on the room to keep a group unlocked, once unlocked, if that is what you want.

Regarding the above comments, that is done in a cheaper way. (well ages ago already)
B
33
S
18
G
27
Posts: 2,431
Reputation: 20,326


Return to How do I....?

Who is online

Users browsing this forum: Clark Thy Lord, timoteomorelli and 1 guest