[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Slick Forums • View topic - Cloning an entity

Slick Forums

Discuss the Slick 2D Library
It is currently Fri Feb 28, 2020 3:41 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Cloning an entity
PostPosted: Wed Jan 30, 2013 1:59 pm 
Offline

Joined: Thu Oct 25, 2012 5:29 pm
Posts: 31
Earlier I had a question about render order. (if A.getID()<B.getID(), then B will always be rendered on top of A). I worked around this by copying all the information from A into a new entity C, components and all, which then had a higher ID # and it then moved to the top each time it was touched.

But at that point I wasn't really using the whole entity/system framework as intended. I had different movement systems for each type of entity and wasn't sharing any of the same code to do the same functions. Now I am.

Unfortunately I was specifically taking A and because its movement system was specific for it's type of entity copying the same way wont work.

Is there a more generic way to copy an entity in Artemis, components and all, without hard coding cases for each different collection of components?


Does this make sense?


Top
 Profile  
 
 Post subject: Re: Cloning an entity
PostPosted: Wed Jan 30, 2013 5:58 pm 
Offline
Game Developer
User avatar

Joined: Tue Nov 21, 2006 4:46 am
Posts: 620
Location: Iceland


Top
 Profile  
 
 Post subject: Re: Cloning an entity
PostPosted: Thu Jan 31, 2013 2:12 pm 
Offline

Joined: Thu Oct 25, 2012 5:29 pm
Posts: 31
Ok, thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group