This example uses the flash to make the smoke animation quickly, mainly utilizes the AS3 class to realize.
First we make a photo of the smoke in Photoshop, which is mainly achieved with Photoshop brushes.
Figure 1
Figure 2
Figure 3
We then move into flash and turn to the original movie clip, named Smokepuff. Then we open the library, then right click on the component and set the link.
Figure 4
Then edit the category and the code below.
Package Com.asgamer.graphics
{
Import Flash.display.BlendMode;
Import Flash.display.MovieClip;
Import flash.events.Event;
public class Smokepuff extends MovieClip
{
public Var Vx:number;
public Var Vy:number;
Public Function Smokepuff (): void
{
Alpha = Math.random ();
VX = Math.random ()-math.random ();
VY = Math.random () * 3-5;
ScaleX = ScaleY = Math.random ();
AddEventListener (Event.enter_frame, loop, False, 0, true);
}
Private function Loop (e:event): void
{
Alpha-= 0.01;
Y + + vy;
x + VX;
ScaleX = ScaleY + 0.02;
if (Alpha < 0)
Removeself ();
}
Private Function removeself (): void
{
RemoveEventListener (Event.enter_frame, loop);
Parent.removechild (this);
}
}
}
The properties of the document are:
Figure 5
Then we create a main.as
Package
{
Import Flash.display.Stage;
Import Flash.display.MovieClip;
Import flash.events.Event;
Import Com.asgamer.graphics.Smokepuff;
Import Flash.display.Sprite;
public class Main extends Sprite
{
Public Function Main (): void
{
AddEventListener (Event.enter_frame, loop, False, 0, true);
}
Private function Loop (e:event): void
{
var smokepuff:smokepuff = new Smokepuff ();
smokepuff.x = 250;
SMOKEPUFF.Y = 250;
Stage.addchild (Smokepuff);
}
}
}