GML Expanding Circular Collisionbox

M

Maiku Davis

Guest
I need a circular collisionbox that can expand or shrink with a (variable) number value.

I've tried:
//STEP EVENT
cor_radius = random_range(cor_rMin,cor_rMax); //randomize core size
rad_radius = random_range(rad_rMin,rad_rMax); //randomize radiation zone size
if collision_circle(x,y,cor_radius,ground,true,true) {other.hp = 0;}

The size does change, but I can't seem to recall the true state of the collision with other instances. How'd I screw up? :X
 

Ralucipe

Member
GMCJam Champ
collision_circle returns an instance id, not a boolean. You'd need to perform a check such as

Code:
if (collision_circle(x,y,cor_radius,ground,true,true) != noone) {....}
 
M

Maiku Davis

Guest
Thanks! I'd been stuck on this forever.
I guess what I was trying to ask was "how do I change the code to check for boolean instead of an ID?"
You answered it!
 
Top