## **心得分享**
给大家分享下一关于数据结构中自己踩过的坑。
* 数据结构可以用来处理绝大部分的数据相关功能,所以游戏比较简单的话不用再去尝试使用类似MYSQL等相关功能。
* 数据结构相当于指针结构,也就是关联数据结构的变量被注销后(例如:使用VAR申明的临时变量或切换ROOM)依然不会把数据结构本身给注销,所以在这里一定要注意几点:
* 尽量不要在循环/步/绘制中持续的创建新的数据结构,因为这会让你在摧毁的时候变得无所适从
* 对于不再使用的数据结构一定要记得摧毁(或记录),否则当你游戏运行时可能会莫名其妙出现内存增长不停的情况
* 对于多层嵌套的数据结构,摧毁掉最外层数据结构之后,也会把内部的所有数据结构给摧毁,反之摧毁掉内部数据结构,并不影响外层结构的其他数据,但是被摧毁的结构读取时会为undefine。(例如:变量A指向ds_map,其中一个键名为"list",键值是个ds_list结构的数据并用变量B指向这个ds_list,当摧毁掉变量A时,再次使用变量B会提示错误,反之摧毁掉B时,再次使用"list"来寻找他的value会得到一个undefine。由此分析可得到,当你不需要这个ds_map时,则需要直接注释掉变量A,但是当你不再需要使用变量B时,则无需摧毁掉变量B)
- 简言
- 额外接口
- 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)