Search code examples
game-enginegame-physics

Bubbles like smoke ..2D effect. How to?


I'm new to game programming..What I want to achieve is an effect like bubbles which behaves like smoke in 2D. I will explain...I don't want a realistic effect or fog. I want to do something like bubbles in the background which fly in the sky and become bigger and bigger and move like they are suspended in space. They become bigger until they reach some size. Something like this

What is the best way to achieve this ? Is there somewhere in the skynet? Some examples or ready effects? Where to start ? I program in Java but even though the examples are in C++ or other languages it really doesn't matter.


Solution

  • I assume you have a method to draw already, like openGL or Canvas.
    You probably want to create the balls as objects with variables like x,y,size etc. Then when you draw it, make sure you updated these variables, by for example increase the size if you want it to become bigger, or the x if you want it to move to the right.

    Other option is to create an animated image like a .gif ofcoarse.