Class Room
This is an object to store the views of each room and draw the corresponden view to the screen.
Functions:
- Draw the view with current direction.
- Determine the direction is connected or not.
- Perform the animation control.
etc.
Constructor Summary
nil
Method Summary
- (id) initMemeber:(int)initType
Start to initialize the Room object with the room type.
- (void) drawRoom:(CGPoint)point dir:(int)dir animatedTimer:(int)time animationType:(int)animationType
Draw the view of the room with the direction.
- (void) drawAnimation:(Texture2D*)texture point:(CGPoint)point time:(int)time animationType:(int)animationType
Control the animation position, type and time.
- (BOOL) goForward:(int)direction
Check the connective between rooms (depend on the direction).
- (BOOL) goBackward:(int)direction
Check the connective between rooms (depend on the direction).
- (void) setConnected:(BOOL)up down:(BOOL)down left:(BOOL)left right:(BOOL)right
Set the connective of this coom.
Constructor Detail
initMemeber
- (id) initMemeber:(int)initType
Initialize the Room with type.
Parameters:
initType : Room type.
Returns:
self object reference.
drawRoom
- (void) drawRoom :(CGPoint)point dir:(int)dir animatedTimer:(int)time animationType:(int)animationType
Draw the view of the room with the direction.
Parameters:
dir : the character direction. time : animation timer. animationType : witch type of animation need to perform.
Returns:
nil.
drawAnimation
- (void)drawAnimation:(Texture2D*)texture point:(CGPoint)point time:(int)time animationType:(int)animationType
This method will determine to draw animation or normal view.
Parameters:
texture : texture of current view. point : position texture. time : animation timer. animationType : witch type of animation need to perform.
Returns:
nil.
goForward
- (id) goForward:(int)direction
Check the connective between rooms when user want to go forward.
Parameters:
direction : Character direction at the Maze.
Returns:
TURE or FALSE.
goBackward
- (id) goBackward:(int)direction
Check the connective between rooms when user want to go backward.
Parameters:
direction : Character direction at the Maze.
Returns:
TURE or FALSE.
setConnected
- (void) setConnected:(BOOL)up down:(BOOL)down left:(BOOL)left right:(BOOL)right
\\
Set the connection of the room.
Parameters:
up : have another room connected when user go up. down : have another room connected when user go down. left : have another room connected when user go left. right : have another room connected when user go right.
Returns:
nil.
more method will be added later