E
ezravitto
Guest
Hi! I need help implementing quadtree to my rts game, but the "insertion" part of Quadtree doesn't make sense to me, gml is the only programming language i use.
so here's my insertion code:
Thankyou for giving time!
so here's my insertion code:
GML:
if instance_exists(oQuadPointTest)
{
var _check;
_check = instance_find(oQuadPointTest,instance_number(oQuadPointTest)-1)
if !scrContain(_check){return 0;}//this will return the object id if it is true
if ds_list_size(_objects)<capacity
{ds_list_add(_objects,_check);}
else
{if !_divided {scrSubdivide();}}
}