Skip to main content

Timeline for Reusable skill class structure

Current License: CC BY-SA 2.5

6 events
when toggle format what by license comment
Feb 26, 2011 at 23:37 comment added michael.bartnett If you want to maintain state inside of your SampleAttack class for cooldowns or other things on a per mob instance, then that requires a SampleAttack instance for each mob. If you don't need to track state, or if you are tracking with another field in the mob class, when you can use the static method route. But then you have no type safety. You could provide a GetInstance method for each attack and treat them as singletons. It really depends on your game.
Feb 26, 2011 at 22:48 comment added omgnoseat Oh nice, didn't realise this! thanks :) Another thing I was wondering, how should I call the attack class to execute it? Should the class be static so I could just call it like "sampleattack.execute" or should I make it a regeular class and initialize it as followed: "var attack:sampleattack = new sampleattack()". Not sure whats appropiate in this case.
Feb 26, 2011 at 21:41 history edited michael.bartnett CC BY-SA 2.5
Fixed Vector.<Skill>
Feb 26, 2011 at 21:27 comment added michael.bartnett AS2 or AS3? If you're using AS3 check here: help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/… Adobe recently added this class to Flex 4 in order to make operations on a container of elements of all the same type more efficient. You should definitely use it if you're able.
Feb 26, 2011 at 20:33 comment added omgnoseat Thanks for your response. The mob class is just a general class which every interactive object in the game world will extend. I'm using actionscript which doesn't natively support vectors, but I get the idea!
Feb 24, 2011 at 22:56 history answered michael.bartnett CC BY-SA 2.5