Solved: [ZoomOut when Plattformer is moving]

Get help using Construct 2

Post » Wed Nov 02, 2011 9:33 pm

Hi. I try to do some "Camera Effects". But I dont no exactly how.
But let me show you what I want to do:

http://www.tastybytes.de/justintime/zoomOut/index.html

When the Player is running the "camera" should zoom out smoothly. When the player stops it should zooming in.

Here is the capx.

I have two problems.
1.) The change between zooming out and zooming in isnt smooth. I have no idea how I could do this.

2.) The paralax background jumps.

Do you have some ideas?TastyBytes2011-11-05 12:16:28
B
14
S
2
G
6
Posts: 110
Reputation: 3,849

Post » Wed Nov 02, 2011 9:51 pm

http://dl.dropbox.com/u/36472942/construct/forumhelp/zoomOut_Fixed.capx

For the paralax, I set the Y value to 100. But with a more complete project I think this won't be a valuable long term solution.

The smooth zooming is covered though. Wait and see what others have to propose about the paralax.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Wed Nov 02, 2011 9:59 pm

Kyatric, you rock! I have to catch on what you have done there. Looks cool!
B
14
S
2
G
6
Posts: 110
Reputation: 3,849

Post » Wed Nov 02, 2011 10:04 pm

I simply added a condition, to make sure if the maximum (or the minimum) layoutscale number was not yet reached (depending on if the sprite is moving or not).
From there, I add (or substract) a value (* dt for framerate independency) each tick.

Change the value 0.3 to lengthen or shorten the length of the zoom.
Kyatric2011-11-02 22:05:24
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Thu Nov 03, 2011 12:06 am

[QUOTE=Kyatric] I simply added a condition, to make sure if the maximum (or the minimum) layoutscale number was not yet reached (depending on if the sprite is moving or not).
From there, I add (or substract) a value (* dt for framerate independency) each tick.

Change the value 0.3 to lengthen or shorten the length of the zoom.
[/QUOTE]

simply...he says.
B
52
S
17
G
15
Posts: 1,029
Reputation: 26,339

Post » Thu Nov 03, 2011 1:19 am

Yeah, "simply." It's hard for geniuses like Kyatric to remember what it's like to be as lowly as us.
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Thu Nov 03, 2011 1:32 am

[QUOTE=harrio]simply...he says.[/QUOTE]

[QUOTE=SullyTheStrange] Yeah, "simply." It's hard for geniuses like Kyatric to remember what it's like to be as lowly as us.[/QUOTE]

Don't see the fnords and they won't eat you!
B
75
S
16
G
12
Posts: 322
Reputation: 11,608

Post » Thu Nov 03, 2011 2:33 am

The genius is in C2/coding, not in me ^^
I suspect that guy R0j0hound who can make your computer cook irl pancakes in three events or that dude Ashley who built C2 to be actual geniuses.

New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Thu Nov 03, 2011 6:22 am

Another good place for lerp.

is not moving-set layout scale to:lerp(layoutscale,1,0.5*dt)


is moving-set layout scale to:lerp(layoutscale,1.5,0.5*dt)

Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271

Post » Fri Nov 04, 2011 9:15 pm

Hi again. Is it possible to scale single layers?
i have done this:

Event:
Player | Platformer is moving
System | layoutscale < 1.3    

Action:
System | Set layer 0 scale to layoutscale + 0.3*dt

Event:
Player | Platformer is not moving
System | layoutscale > 0    

Action:
System | Set layer 0 scale to layoutscale - 0.3*dt

But nothing happensTastyBytes2011-11-04 21:17:06
B
14
S
2
G
6
Posts: 110
Reputation: 3,849

Next

Return to How do I....?

Who is online

Users browsing this forum: Nifl and 27 guests