Hi guys!
[COLOR=#000000][FONT=verdana]I’m working on a little sidescroller as my first AS3 project.[/FONT][/COLOR]
[COLOR=#000000][FONT=verdana]I’ve been thinking of ways to add shadows that interact with my characters using a colourTransform. [/FONT][/COLOR]
[COLOR=#000000][FONT=verdana]My problem is understanding exactly how classes interact with one another.[/FONT][/COLOR]
[COLOR=#000000][FONT=verdana]For instance, I have a ‘shadowtrigger’ class instantiated in a ‘Level1’ object with the trigger box object added to the stage. I also have a ‘character’ class instantiated in the ‘Level1’ object and likewise added to the stage. The only way I can think of to get them to interact is to put the hitTest-ing code in the ‘shadowtrigger’ class and have it refer to the character using[/FONT][/COLOR]
[COLOR=#000000][FONT=verdana]ActionScript Code:
([COLOR=#993300]this[/COLOR].parent as [COLOR=#993300]MovieClip[/COLOR]).character
[/FONT][/COLOR]
[COLOR=#000000][FONT=verdana]which as far as I know is not an ideal way to do it. [/FONT][/COLOR]
[COLOR=#000000][FONT=verdana]I want to have an NPC running around (a single basic scripted scene, nothing too crazy) and I want this NPC to be able to trigger and be darkened by this shadowtrigger for as long as it’s within the trigger.[/FONT][/COLOR]
[FONT=verdana, geneva, lucida, lucida grande, arial, helvetica, sans-serif][COLOR=#000000]To save on coding and whatnot, is there any way I can make this trigger detect any moving object and then apply the shadow effects to that object?
I imagine I would have to do something like create a class ‘Character’ then make a bunch of sub-classes then have individual character properties and whatnot, and then have the trigger listen for collisions with class ‘Character’ or something. I’m really not sure!
Thanks heaps![/COLOR][/FONT]