- Controller - basically the game controller/logic. The master.
- Drawer - draws stuff on the stage.
- Room - contains generic information about each of the rooms.
- Kitchen - a subclass of Room containing kitchen specific stuff. Want to do that for each of the rooms (polymorphism). It may be overkill at this stage. It depends on how different each of the rooms end up being in terms of behaviour.
- Character - stuff about characters.
- ControllableCharacter - initally this is linked to the Skanky Dred Fred (SKD) movie clip, and gets instantiated when the character is attached to the map. Has key listeners attached to it so you can move him around.
- Door - the connecting elements between rooms (haven't got as far as coding this yet).
- xxxxFactory - Factory classes to get instances of objects.
Having a major problem at the moment:
1/ Linking movie clips to ActionScript 2.0 classes. It doesn't seem to be working for me at the moment. I have the ControllableCharacter class linked to a movie clip 'sdf', which is the Skanky Dred Fred character.
The clip is getting created on the stage with attachMovieClip (which works fine), and the ControllerCharacter class is getting instantiated. But then I try and refer to this._x and this._y is comes up undefined. I tried a trace with 'instanceof' to check what object type this was and it came up with:
trace(this instanceof Object) => true
trace(this instanceof MovieClip) => false
trace(this instanceof ControllerCharacter) => false
It should at least be an instanceof MovieClip as my ControllableCharacter extends the MovieClip class.
Also tried casting 'this' to a MovieClip and that didn't work either!!!!
Stumped at the moment about why this is occurring.
Not sure how useful the clip-class linking will be for our purposes as when the character moves from room to room the previous room clips will get unloaded (i.e. object deletion and associated loss of data). Because I want to keep the room data when the room is unloaded, I will need to store the data in another object/class.
signing off
the-thwarted-one
No comments:
Post a Comment