GameMaker Touhou Engine   Home   Downloads   Documentation

_LASER_GENERATOR_PARENT


The object that serves as a sort of delay cloud for loose lasers but also handles some of their logic.


Locals:


Name Value/Default Significance
_CREATED_LASER <object>/_LASER_PARENT The laser object that the generator should create.
_CREATED_LASER_SPRITE <sprite>/noone The sprite of the laser that should be created.
_CREATED_LASER_ANGLE <integer>/0 The movement direction of the laser that should be created.
_CREATED_LASER_SPEED <integer>/0 The movement speed of the laser that should be created.
_CREATED_LASER_DEATH_EFF <sprite>/noone The sprite to create a particle out of when the created laser gets destroyed.
_CREATED_LASER_ID <integer>/0 Stores the id of the laser that should be created, after it's been created.
_FIRST_ANIMATION <sprite>/noone The appearing animation of the delay cloud. This animation will stay on it's last frame until the laser has been fully fired.
_SECOND_ANIMATION <sprite>/noone The disappearing animation of the delay cloud.
_TEMP_SURFACE <surface>/noone The surface which the laser's sprite will be copied from while it's being fired.
_LASER_CREATED <boolean>/false true: The laser has begun firing or has been fully fired and is now moving. false: The laser has not yet started being fired.
_CURR_Y <integer>/-1 How much of the laser's sprite has been drawn, i.e. how far the laser is into being fired.

Events:


Trigger # Actions
Create 1 Set local variables to default values.
Destroy 1 Free up the dynamic resources used by the instance.
Alarm[0] 1 Set _CREATED_LASER_ID, point the laser in the designated direction and set it's _DEATH_EFF. Set _LASER_CREATED to true.
Step 1 If the laser is being fired, increase how much of the sprite is being drawn based on the designated speed.
Animation End 1 If appearing, freeze own animation on the last frame and set Alarm[0] to a very small value. If it's disappearing, destroy itself.
Draw 1 If _TEMP_SURFACE is valid, clear it and draw part of the designated laser sprite according to _CURR_Y. Replace the sprite of the created laser with the sprite drawn on the surface. If the entire laser's been drawn, release the laser and make it start moving, set own animation to the disappearing one. Draw self regardless.