Solved: [ZoomOut when Plattformer is moving]

0 favourites
From the Asset Store
This is a code so you can see the same skin on all screens (peers). Each peer gets a skin, in addition to 4 directions t
  • Hi. I try to do some "Camera Effects". But I don?t 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 isn?t smooth. I have no idea how I could do this.

    2.) The paralax background jumps.

    Do you have some ideas?

  • zoomOut_Fixed.capx

    For the parallax, 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 parallax.

  • Kyatric, you rock! I have to catch on what you have done there. Looks cool!

  • 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.

  • 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.

    simply...he says.

  • Yeah, "simply." It's hard for geniuses like Kyatric to remember what it's like to be as lowly as us. <img src="smileys/smiley17.gif" border="0" align="middle" />

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • simply...he says.

    Yeah, "simply." It's hard for geniuses like Kyatric to remember what it's like to be as lowly as us.

    <img src="smileys/smiley36.gif" border="0" align="middle" />

  • 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.

    <img src="smileys/smiley9.gif" border="0" align="middle" />

  • 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)

  • 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 happens

  • Stay consistent.

    Replace all "layoutscale" by layer 0 scale in your code.

  • Do you mean?

    "layer0scale" or "layer.0.scale" ? Dont know the correct syntax.

    Sorry, im a noob in expressions.

  • Set layer 0 scale to layerscale(0) + 0.3*dt

  • Thank you! Now it works fine!

  • "Genius" is just another word someone who-

    a: read alot

    b: read even more

    c: practiced

    d: experimented

    3: taken lots of drugs ;p

    4: you didnt notice I changed from letters to numbers did you

    e: pays attention to small details

    f: reads alot

    g: doesnt repeat themselves often

    h: relaxes and looks at the world alot(see "e:" above)

    i: Doesn't worry about irrelevant things...such as trolling etc unless really, really funny...

    :)

    Dont worry

    even lofty genius is achievable in anyone's lifetime...

    just depends on how bad you want it

    BE BAD..!

    get studying

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)