- Return to Touhou Danmakufu: Syntax
Overview[]
User-defined bullet graphics can be added by using LoadUserShotData function, which is called with the path of the bullet definition script. Animated bullets can be defined.
Example[]
The following is an example of the bullet definition script.
#UserShotData // Required ShotImage = ".\UserShot.png" // Image of Bullets // Definition of bullet ShotData { id = 1 // Bullet ID rect = (0, 0, 32, 32) // Region in the ShotImage render = ALPHA // Render type delay_color = (255, 128, 255) // Color of light on delay angular_velocity = rand(-5, 5) // Ang. vel. of graphic rotation } // New-lines are not required. ShotData { id = 2 rect = (0, 0, 16, 16) } // Animated bullet ShotData { id = 3 render = ADD delay_color = (255, 128, 255) AnimationData { // 16 frames ( 0, 0, 12, 12) // -> 8 frames (12, 0, 24, 12) // -> 24 frames (12, 12, 24, 24) // -> Repeat... animation_data = (16, 0, 0, 12, 12) animation_data = ( 8, 12, 0, 24, 12) animation_data = (24, 12, 12, 24, 24) } }
Details[]
#UserShotData[]
#UserShotData describes that this file is a bullet definition script.
ShotImage[]
ShotImage indicates the path of the image of bullets. All the graphics of the bullets must be combined into one image file. The black region (R, G, B = 0, 0, 0) is transparent.
ShotData[]
ShotData indicates information of a bullet.
id[]
id is the ID of the bullet. This ID is used instead of the name of the pre-defined bullets. e.g.
CreateShot01(GetX, GetY, 5, GetAngleToPlayer, 1, 0);
The ID must be a unique positive integer (0 is invalid).
rect[]
rect is the rectangular region of the bullet in the ShotImage.
rect = ( (left), (top), (right), (bottom) )
render[]
render indicates the render type.
ALPHA
Alpha blend (default)
ADD
Addtive blend
delay_color[]
delay_color indicates the color of the light which is drawn during delaying firing.
delay_color = ( (red), (green), (blue) )
The default is (128, 128, 128).
angular_velocity[]
'angular_velocity' is the angluar velocity of the graphic rotation. The rotation center is the same as the center of the rect.
The default is 0.
AnimationData[]
AnimationData defines the motion of the animated bullet.
AnimationData { animation_data = ( (frame), (left), (top), (right), (bottom) ) animation_data = ( (frame), (left), (top), (right), (bottom) ) ... }
(frame) is the number of frames that the graphic keeps to be drawn.
If AnimationData exists, rect is ignored.
Comments[]
/* comment */
// one-line comment
For details to Touhou Danmakufu: Miscellaneous.
- Return to Touhou Danmakufu: Syntax