Archived

This topic is now archived and is closed to further replies.

How to init my particle constructor?

This topic is 5535 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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)
};

Share this post


Link to post
Share on other sites