check the tutorials section inside Start->Programs->theGameCreators->DarkGDK->Tutorials
there is a good 2D particle tutorial over there which is pretty simple and looks nice.
beside that you can always make a small bitmap with windows painter and just use a manipulation of it inside GDK , you create one Object and one image dbLoadImage, assign the bitmap to it , hide the object.
then inside the main loop whenever there is a Collision or whatever you want to do , you paste the hidden Object into that Collision Location and just randomly send it somewhere or not randomly.
take a look at this example
// first
dbLoadImage("Fire.BMP",1); // remmber it should hold transpercy so maybe the use of Png will be better here.
dbMakeObjectPlane(1,10); // you can use Box or Sphere but it will take much more GPU, in the case of Plane remmber always to "Point it" at the location of the camera that the player use so you can see its face or texture , if the face wont be rotated towards the Camera or Player sight you wont see it .
dbTextureObject(1,1);
dbHideObject(1);
// second we will setup an empty array of objects that will act like particles we only need an Array of Id's not something too fancy, remmber that this is only the Collision Particles and not all of the particles , in this method which is super simple each particles will have to have an Array of Id just to keep track on them.
int CollisionParticle[100] = 0; // 100 the amount of particles you want
// Setuping the particles
for (int i = 0; i < 100; i++)
{
// First we'll manipulate the Source Object this will give you tons of ideas on how to change one particle from another, rotation , scale , maybe a diffrent texture usage for it .. whatever you want.. just remmber the Source is hidden
dbScaleObject(1,dbRnd(10));
dbRotateObject(1,dbRnd(360),dbRnd(360),dbRnd(360));
// the actuall particle , look at the bottom for GetFreeObject()
CollisionParticle[i] = GetFreeObject();
dbCloneObject(CollisionParticle[i],1);
dbPositionObject(CollisionParticle[i],0,0,0);
dbHideObject(CollisionParticle[i]); // hide it for now
} // end of Setuping Loop
// Main loop
if (Collision) // obviosly your own code ..
{
// setuping positions only once per collision
if (!PrtclePositioned)
{
for (int i = 0; i< 100;i++)
{
dbPositionObject(CollisionParticle[i],collisionX,collisionY,collisionZ);
}
PrtclePositioned = true;
PrtcleTimer = dbTimer(); // this will Save us the Time the particles where setuped and we will put a limit so it wont be too long and wont be too quick.
}
}// end of Collision
/later on in the loop
if (PrtclePositioned)
{
for (int i = 0;i < 100;i++)
dbMoveObject(CollisionParticle[i],1); // you might wanna change the speed of movement it all depends of the game and the game paste you are after.
}
// checking for the Time
if (PrtcleTimer + 2000 > dbTimer()) // + 2000 is the amount of the time limit or life duration of the Particles
{
PrtclePositioned = false; // since the Particle life duration has ended we are watinig for the next collision to accour , so until then the Moving is stoped and the object return Hidden.
for (int i =0;i < 100;i++)
{
dbHideObject(CollisionParticle[i]);
// we can also reset the rotation and scale and manipulate it again each time theres a Collision so every time you will get a diffrent look for the collision particle , however this may take some time and you may get a small slow down each time that happens and we dont want that while playing.
}
}
i hope this help , i may have forget something tell me if it works.
edit i forgot the GetFreeObject();
int GetFreeObject()
{
int i = 1;
while (dbObjectExist(i) == 1)
{
i++
}
return i; // once the While loop will be false it meens that the Id placed in i is an Empty Object Id.
}