Do you have lots of instances being created and destroyed? Tired of long instantiation times? Look no further than Instance Pooling Made Easy, a drop in system for basic instance pooling.
Includes the following core functions:
instance_pooling_init()
called once at the beginning of your game or room
instance_pooling_cleanup()
called once at the end of your room or game to free up resources
instance_create_layer_pooled(x, y, layer, object)
called instead of instance_create_layer(x, y, layer, object)
instance_create_depth_pooled(x, y, depth, object)
called instead of instance_create_depth(x, y, depth, object)
instance_destroy_pooled(instance)
called instead of instance_destroy(instance), note the argument requirement
As well as these utility functions:
instance_pooling_clear_pool()
call when you want to clear out the pool for some reason
instance_pooling_pool_size()
call if you want to know the current size of the instance pool
pool_contains_object(obj)
returns the id of an instance if its found in the pool, otherwise returns noone
v1.0.0 - initial release
v1.0.1 - fixed a memory leak
v1.0.2 - changes to allow this asset to work with non-physics objects as well as physics objects
v1.0.3 - bug fixes, more utility scripts
End User Licence Agreement (EULA).