M
Mike2
Guest
Hi, I'm having problems with precise collision checking with a sprite generated from a surface. I created a circle for collision and an object to collide with. The collision only works as if it was a square, not a circle.
Object A:
Create Event
Draw Event
Object B:
Step Event
Object A:
Create Event
Code:
spr = 0
surfaces = noone;
Draw Event
Code:
if( surface_exists(surfaces) ){
draw_surface(surfaces,x,y)
}else{
surfaces = surface_create(300,600)
surface_set_target( surfaces )
draw_clear_alpha(c_white,1)
draw_circle(100,100,100,0)
spr = sprite_create_from_surface(surfaces, 0, 0, 600, 600, true, true, 0, 0);
mask_index = spr;
surface_reset_target()
}
Object B:
Step Event
Code:
if( place_meeting(x, y, ObjectA) ){
x = 2
}