new Maze_Event()
Event class. Wraps a Game_Event in order to correctly display it on screen.
Methods
draw3D(bitmap, zBuffer, scaleFactor, a, b)
Draws the sprite, one vertical line at the time. A Z buffer is used to determine whether part of the sprite is hidden by a wall. This.distance is used to properly scale the sprite.
Parameters:
| Name | Type | Description |
|---|---|---|
bitmap |
Bitmap on which the sprite will be drawn. |
|
zBuffer |
Array of distances. A line will be drawn only if it's closer than the value stored on the buffer. |
|
scaleFactor |
If other than 1, the sprite will be resized. |
|
a |
Initial angle of the player's field of view. |
|
b |
Final angle of the player's field of view. |
initialize(event)
Constructor. Initialises the event's image, distance and angle from the player.
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Game_Event to be wrapped. |
update()
Update method. It recalculates the position (based on the Game_Event's position) and chooses which side of the event the player will see. The direction fixed flag is not used in the same way as Scene_Map (if true the event won't turn to face the player when triggered), instead it's used to determine whether or not the player sees the same direction when viewing the event from a different angle.