Zelda Scrolling

Post your own tutorials, guides and demos.

Post » Mon Jul 20, 2009 4:38 pm

[quote="newt":7rim0r29]I don't really see the point. So what if objects are still moving while the screen is scrolling?[/quote:7rim0r29]

Because that's how LoZ does it, and this is an example of LoZ style scrolling.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon Jul 20, 2009 7:01 pm

Well adding an extra event, and then taking advantage of the time it takes to go from float to int gave me something like this:
[code:3aw0i21o]System: 0 ScrollY + clamp(DisplayHeight / 2 + floor(Sprite 0 .Y / DisplayHeight) * DisplayHeight - ScrollY, 0 -timedelta * DisplayHeight, timedelta * DisplayHeight) Different to ScrollY
System: OR
System: 0 ScrollX Different to ScrollX + clamp(DisplayWidth / 2 + floor(Sprite 0 .X / DisplayWidth) * DisplayWidth - ScrollX, 0 -timedelta * DisplayWidth, timedelta * DisplayWidth)
> SystemSet time scale to 0[/code:3aw0i21o]
You still need to turn off bounded scrolling, or you'll get that bug at the end, bet ehh add a solid wall there.

You should be able to use time scale in the always event somehow, but Im not seeing it. Clamp is about the only usable function, but getting the numbers right is a pain.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Fri Jul 24, 2009 9:08 am

Yeah, the timescale event is just to emulate LOZ style scrolling. It's not critical but it matches the style.

I love the 1 event solution, David. That was way simpler then what I thought was necessary. :)
B
12
S
4
G
4
Posts: 238
Reputation: 2,426

Post » Sat Oct 05, 2013 9:12 pm

Can you post a .capx? I can't use the file you've posted up there, so I have no idea what you guys are talking about.
Image
B
26
S
6
G
2
Posts: 38
Reputation: 2,427

Post » Sat Oct 05, 2013 9:29 pm

@dpyellow

This thread is over 4 years old.

Also, this is the section for Construct Classic and the files are not usable in Construct 2. Therefore there is no .capx.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
120
S
28
G
68
Posts: 4,841
Reputation: 48,283

Post » Wed Oct 09, 2013 1:34 am

Oh. Heh, you can tell that i've never used these forums before.
Image
B
26
S
6
G
2
Posts: 38
Reputation: 2,427

Post » Wed Oct 09, 2013 8:39 am

@dpyellow

There's nothing to stop you installing the last build of CC and then you could open the .cap.

For reference, the .cap has 2 sprites called Sprite and Sprite2 and the events look like this:

+ System: ScrollX Lower than int(Sprite.X) - ((int(Sprite.X) % 640 )) + 320
-> System: Scroll to X ScrollX + 16
-> System: Set time scale to 0

+ System: ScrollX Greater than int(Sprite.X) - ((int(Sprite.X) % 640 )) + 320
-> System: Scroll to X ScrollX - 16
-> System: Set time scale to 0

+ System: ScrollY Lower than int(Sprite.Y) - ((int(Sprite.Y) % 480)) + 240
-> System: Scroll to Y ScrollY + 16
-> System: Set time scale to 0

+ System: ScrollY Greater than int(Sprite.Y) - ((int(Sprite.Y) % 480)) + 240
-> System: Scroll to Y ScrollY - 16
-> System: Set time scale to 0

+ System: ScrollY Equal to int(Sprite.Y) - ((int(Sprite.Y) % 480)) + 240
+ System: ScrollX Equal to int(Sprite.X) - ((int(Sprite.X) % 640 )) + 320
-> System: Set time scale to 1

The Project size is 6000x6000 and the Layout is 640x480.zenox982013-10-09 08:40:56
If your vision so exceeds your ability, then look to something closer.
Moderator
B
120
S
28
G
68
Posts: 4,841
Reputation: 48,283

Post » Thu Oct 10, 2013 2:41 am

Thanks! I'll keep that in mind.
Image
B
26
S
6
G
2
Posts: 38
Reputation: 2,427

Post » Wed Oct 16, 2013 8:47 am

@dpyellow

If you still need an example for C2, here's one I converted from CC. It may give you the basic idea.

https://dl.dropboxusercontent.com/u/34306693/zelda.capx.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
120
S
28
G
68
Posts: 4,841
Reputation: 48,283

Previous

Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 0 guests