## **part_type_step**
**设定一个粒子类型的所有粒子在每一步都会产生一定数量的另一个粒子类型的粒子**
#### **语法:**
part_type_step(ind, step_number, step_type);
| 参数 | 描述 |
| --- | --- |
| ind | 粒子类型ID |
| step_number | 每一步产生新粒子类型的数量(设置为负值,代表有一定1/所填值的释放几率) |
| step_type | 需要产生的新粒子类型的ID |
**返回:** N/A
#### **描述**
这个函数可以用来使你的粒子类型流每一步都产生另一种粒子类型,直到它的生命周期结束。你可以为把step_number设置一个负值,并以此为基础以随机性发射一个粒子,例如,填写一个-3的值将有1/3的机会每步发射一个粒子。
注意:切勿使用相同的粒子类型,因为这将导致无限循环,并可能在数秒内崩溃游戏!另外,使用这个时要非常小心,因为这会大大增加屏幕上的粒子数量,并导致游戏速度明显下降。
#### **举例:**
~~~
particle2 = part_type_create();
part_type_shape(particle2, pt_shape_smoke);
part_type_size(particle2, 0.01, 0.01, 0.01, 0);
part_type_scale(particle2, 1, 1);
part_type_colour3(particle2, 4227327, 8454143, 4227327);
part_type_alpha3(particle2,1, 0.50, 0.80);
part_type_speed(particle2, 0, 0, 0, 0);
part_type_direction(particle2, 0, 359, 0, 0);
part_type_gravity(particle2, 0, 270);
part_type_orientation(particle2, 0, 0, -2, 0, 1);
part_type_blend(particle2, 1);
part_type_life(particle2, 160, 160);
particle3 = part_type_create();
part_type_shape(particle3, pt_shape_flare);
part_type_size(particle3, 0.20, 0.20, 0.02, 0);
part_type_scale(particle3, 1, 1);
part_type_colour3(particle3, 16777215, 8454143, 16777215);
part_type_alpha3(particle3, 0, 0.50, 0);
part_type_speed(particle3, 3, 3, -0.03, 0);
part_type_direction(particle3, 0, 359, 0, 0);
part_type_gravity(particle3, 0, 270);
part_type_orientation(particle3, 0, 0, 0, 0, 1);
part_type_blend(particle3, 1);
part_type_life(particle3, 40, 80);
part_type_step(particle2, 2, particle3);
~~~
上面的代码创建并定义了两个粒子,并将在变量“粒子2”中建立的粒子设置为每一步两个“粒子3”的粒子。
- 简言
- 额外接口
- asset_get_index
- asset_get_type
- 粒子(PARTICLE)
- 简单粒子系统
- effect_create_below
- effect_create_above
- effect_clear
- ef_all
- 粒子系统
- 粒子系统的创建
- part_system_exists
- part_system_create
- part_system_create_layer
- part_system_get_layer
- part_system_layer
- part_system_clear
- part_system_depth
- part_system_position
- part_system_destroy
- part_particles_clear
- part_particles_count
- 系统绘图
- part_system_automatic_update
- part_system_automatic_draw
- part_system_update
- part_system_drawit
- part_system_draw_order
- 直接创建粒子
- part_particles_create
- part_particles_create_colour
- 粒子类型
- part_type_exists
- part_type_create
- part_type_destroy
- part_type_clear
- part_type_shape
- part_type_sprite
- part_type_size
- part_type_scale
- part_type_speed
- part_type_direction
- part_type_gravity
- part_type_orientation
- part_type_colour_mix
- part_type_colour_rgb
- part_type_colour_hsv
- part_type_colour1
- part_type_colour2
- part_type_colour3
- part_type_alpha1
- part_type_alpha2
- part_type_alpha3
- part_type_blend
- part_type_life
- part_type_step
- part_type_death
- 粒子发射器
- part_emitter_exists
- part_emitter_create
- part_emitter_clear
- part_emitter_region
- part_emitter_burst
- part_emitter_stream
- part_emitter_destroy
- part_emitter_destroy_all
- 数组(array)
- 数据结构(Data structures)
- 心得分享
- ds_exists
- ds_set_precision
- 网格(grid)
- ds_grid_create
- ds_grid_destroy
- ds_grid_width
- ds_grid_height
- ds_grid_resize
- ds_grid_clear
- ds_grid_set
- ds_grid_set_disk
- ds_grid_set_grid_region
- ds_grid_set_region
- ds_grid_shuffle
- ds_grid_sort
- ds_grid_get
- ds_grid_get_max
- ds_grid_get_mean
- ds_grid_get_min
- ds_grid_get_sum
- ds_grid_get_disk_max
- ds_grid_get_disk_mean
- ds_grid_get_disk_min
- ds_grid_get_disk_sum
- ds_grid_add
- ds_grid_add_region
- ds_grid_add_disk
- ds_grid_add_grid_region
- ds_grid_multiply
- ds_grid_multiply_disk
- ds_grid_multiply_region
- ds_grid_multiply_grid_region
- ds_grid_value_exists
- ds_grid_value_disk_exists
- ds_grid_value_x
- ds_grid_value_y
- ds_grid_value_disk_x
- ds_grid_value_disk_y
- ds_grid_copy
- ds_grid_read
- ds_grid_write
- 列表(list)
- 映射(map)
- 队列(Queues)
- 优先队列(Priority Queues)
- 堆栈(stack)