{"author_name":"aaronsnoswell","cat":"MiniLD","comments":[{"author_name":"","time":"January 24, 2013 6:46 am","epoch":1359027960,"text":"Why not make a &#8216;actors-group-with-position&#8217;?","spam":"N"},{"author_name":"deathray","time":"January 24, 2013 7:52 pm","epoch":1359075120,"text":"If you allow for N-textures, then your actor class becomes very versatile. Is there a downside? What are the pros and cons? And what language are you using?","spam":"N"},{"author_name":"","time":"January 28, 2013 5:01 pm","epoch":1359410460,"text":"Posted a reply to your post on StackExchange.  Basically I would be careful of making your Actor class too complicated, you&#8217;ll regret it down the road. I would suggest adding some kind of parenting or constraint system and represent the tank as two Actors that are parented or constrained together.","spam":"N"}],"epoch":1359002760,"likes":0,"metadata":{"p_key":"47274","p_author":"aaronsnoswell","p_authorkey":"5348","p_urlkey":"82937","p_title":"Actors with multiple Textures","p_cat":"MiniLD","p_event":"LD25","p_time":"1359002760","p_likes":"0","p_comments":"3","p_status":"UPD5","us_key":"5348","us_name":"aaronsnoswell","us_username":"aaronsnoswell","event_start":"1355443200","event_key":"14","event_name":"LD25"},"text":"<p>Hi all!<\/p>\n <p>This is a shameless re-post of my <a href=\"http:\/\/gamedev.stackexchange.com\/questions\/47991\/actors-with-multiple-textures-class-hierarchy\">Stack Exchange Game Development question<\/a> of the same name.<\/p>\n <p>In my 2D side-scroller game I have a bunch of actors being drawn, each of which has a single, non-animated\u00a0<code>Texture<\/code>\u00a0(a png image). These actors all inherit from a base\u00a0<code>GameActor<\/code>\u00a0class.<\/p>\n <p>I want to add some more NPC&#8217;s (e.g. tanks or cannons) that have one texture that doesn&#8217;t move (the base) and another that rotates to shoot at things (the gun \/ barrel). How should I structure my Actor class hierarchy so as to allow for this? Should I refactor my base Actor class to allow for N textures? Or should I create a brand new sort of Actor for things that need &gt; 1 texture (and then have to manage these actors separately from &#8216;regular&#8217; actors)? Or is there a better approach I can&#8217;t see?<\/p>\n <p>Thus far I&#8217;ve been opting to keep things as simple as possible (<a href=\"http:\/\/en.wikipedia.org\/wiki\/KISS_principle\" rel=\"nofollow\">KISS<\/a>, right?), but am not sure how to proceed.<\/p>\n <p>Any pointers greatly appreciated.<\/p>","time":"January 23rd, 2013 11:46 pm","title":"Actors with multiple Textures"}