Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (Nymphodora, AndrewAMD, Quad, TipmyPip), 889 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Animated Particles [Re: Reconnoiter] #465568
05/03/17 21:53
05/03/17 21:53
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
The emulated particles do increase the count of functions running!

Re: Animated Particles [Re: jumpman] #465575
05/04/17 10:04
05/04/17 10:04
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Hey, jumpman

Look into 'particles.c' in game studio root folder. You can see that each particle has it's own while loop (p_run_sprite). But I guess you could make your own particles with sprites and handle all of them in one loop.

Greets!

Edit:
Originally Posted By: Reconnoiter
it probably uses static list and not a while for each sprite particle
Nothing build-in works that way tongue
Code:
// internal sprite lifetime and movement function
function p_run_sprite(ENTITY* p)
{
   while (p._LIFESPAN > 0) 
   {
      vec_fill(p.scale_x,0.1*p._SIZE);
      wait(1);

	   if(is(p,_MOVE)) 
	   {
		   VECTOR speed;
		   vec_set(speed,p._VEL_X);
		   vec_scale(speed,time_step);
		   p._VEL_Z -= p._GRAVITY * time_step;
		   vec_add(p.x,speed);  
		}
	   
	   p._LIFESPAN -= time_step;
   }
   ent_remove(p); 
}


Last edited by 3run; 05/04/17 10:05.

Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Animated Particles [Re: 3run] #465577
05/04/17 12:27
05/04/17 12:27
Joined: Aug 2003
Posts: 118
Deutschland
E
Ezzett Offline
Member
Ezzett  Offline
Member
E

Joined: Aug 2003
Posts: 118
Deutschland
These emulated particles are using ent_createlocal which is identical to ent_create (except when your are creating a game with online functionalities). Each emulated particle is an entity like every other entity.

Re: Animated Particles [Re: Ezzett] #465580
05/04/17 12:57
05/04/17 12:57
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline
Serious User
Reconnoiter  Offline
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
How about using standard particles and change the p.bmap in the p.event function? You can use skill_a...skill_z as timer conditions or whatever. Might be worth a try.

Last edited by Reconnoiter; 05/04/17 12:57.
Re: Animated Particles [Re: Reconnoiter] #465588
05/04/17 23:01
05/04/17 23:01
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
Thanks! I can do that, though I wouldnt be able to rotate the sprite, which is probably the main reason why I looked into the emulated particles.

Re: Animated Particles [Re: jumpman] #465590
05/05/17 10:27
05/05/17 10:27
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline
Serious User
Reconnoiter  Offline
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Ah okay. You could somewhat simulate the rotation by using several rotated versions of a bmap for particles but I dont know if that is worth the effort. The fps gain might be minimal anyway in the big picture.

Last edited by Reconnoiter; 05/05/17 10:28.
Page 2 of 2 1 2

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