Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Newbie Questions
by AndrewAMD. 12/04/23 11:14
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
4 registered members (TipmyPip, Quad, alibaba, izorro), 545 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
trying to create some particles #251770
02/14/09 19:26
02/14/09 19:26
Joined: May 2008
Posts: 13
Greece
N
ngiannakas Offline OP
Newbie
ngiannakas  Offline OP
Newbie
N

Joined: May 2008
Posts: 13
Greece
trying to make some particles from the example in the help file, though I doing something really wrong because can't seem to be able to produce any kind of output
here is the code I am trying

Code:
#include <acknex.h>
#include <default.c>

BMAP* particle_bmap = "light_red.tga";
var sploder_center[3] = { 50.0, 0.0, 0.0 };
var null_vector[3] = { 0.0, 0.0, 0.0 };

function vec_randomize (VECTOR* vec, var range)
{
   vec_set(vec,vector(random(1)-0.5,random(1)-0.5,random(1)-0.5));
   vec_normalize(vec,random(range));
}

function part_alphafade(PARTICLE *p)
{
   p.alpha -= 2*time_step;
   if (p.alpha <= 0) p.lifespan = 0;
}

function effect_explo(PARTICLE *p)
{
   VECTOR vTemp;
   vec_randomize(vTemp,10);
   vec_add(p.vel_x,vTemp);
   p.alpha = 25 + random(25);
   p.bmap = particle_bmap;
   p.flags |= (BRIGHT | MOVE);
   p.event = part_alphafade; // change to a shorter, faster function
}

function main()
{
	while(1)
	{
		effect(effect_explo,1000, sploder_center, null_vector);
		wait(-1);
	}
}


can someone help me out with this please and enlighten me?

Re: trying to create some particles [Re: ngiannakas] #251782
02/14/09 20:22
02/14/09 20:22
Joined: May 2008
Posts: 13
Greece
N
ngiannakas Offline OP
Newbie
ngiannakas  Offline OP
Newbie
N

Joined: May 2008
Posts: 13
Greece
please forget this one, stupid me did not know I needed to load a level, all fixed now and thanks for helping


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1