Spawn X number of bubbles then move to position?

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

  • 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 (:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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)