Spawn X number of bubbles then move to position?

0 favourites
  • 5 posts
From the Asset Store
Jump on numbers in the proper order and reach the sun!
  • whats the best way to spawn 10 little bubble(pre made art) at a object on collision, But after they spawn they move to a certain position??

    You know in games, Where you collect a crystal so then it moves to the HUD? Kinda like that i guess..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Global variable xDestination = what you want
    Global variable yDestination = what you want
    Player: on Collision with Item
        -> Item: spawn bubble
    system: every tick
        -> bubble: set X to lerp(self.x,xDestination,1-0.5^dt)
        -> bubble: set Y to lerp(self.y,yDestination,1-0.5^dt)

    Should work.

    If you want to spawn your bubbles on a HUD layer with different parallaxe values it's a bit different. Don't remember how to project coordinates through layers.

  • Thanks Yann !!! Yet again you never cease to amaze me!!

    If i want to change the size of the object over time should i again use lerp?

    something like:

    system: every

    lerp(self.width, targetScale,1*dt)

  • yep do that for width and height

    and it's more targetWidth and targetHeight (or targetSize if they have the same Width and Height) because a scale is a ratio between the new scaled width and the original width (:

  • Thanks Yann,

    you should have a signature,

    "Yann, Making games better" :D:D:D

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