How to init my particle constructor?

Started by
4 comments, last by Allebarde 21 years, 6 months ago
Hi! I have a class called _PARTICLE and i initialise the number of particles with the constructor: _PARTICLE _Meteor(50); // 50 particles What i want to do is create 10 meteors like that _PARTICLE _Meteor[10](50); But here i get an error, how can i do to create 10 _Meteor initialised with 50 particles? Thanks
Advertisement
_PARTICLE _Meteor[50];

for (int i = 0; i < 50; i++)
{
_Meteor._PARTICLE(50);
}

I think this works.

Bye
quote:Original post by _Rambo_
_PARTICLE _Meteor[50];

for (int i = 0; i < 50; i++)
{
_Meteor._PARTICLE(50);
}

I think this works.

Bye


You mean "_PARTICLE _Meteor[10];" ?

[edited by - Kurioes on October 19, 2002 10:05:27 AM]
I didn''t know you could actually do it like this (might not even be standard, dunno), it''s a bit of a pain and theres probably an easier way:


  _PARTICLE _Meteor[10] = {  _PARTICLE(50),_PARTICLE(50),_PARTICLE(50),_PARTICLE(50),_PARTICLE(50),_PARTICLE(50),_PARTICLE(50),_PARTICLE(50),_PARTICLE(50),_PARTICLE(50)};  
Yeah, the last one works very well, thanks!!

_PARTICLE _Meteor[10];

for ( int i = 0; i < 10; i++ )
_Meteor._Particle(50);
Domine non secundum peccata nostra facias nobis

This topic is closed to new replies.

Advertisement