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..
Develop games in your browser. Powerful, performant & highly capable.
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