W
Wretched.Dunce
Guest
I'm making an asteroids-like shooter and I'm currently trying to get the speed value of an object before collission and calculate the "push back". I'm not using the built in physics engine cause I guess I hate myself, lol.
However whenever two objects collide the game crashes saying "obj_enemy.speedometer not set before reading".
For physical objects that can collide I have created a parent group that detects collissions and reacts. Heres the code for those objects:
Create Event:
Step Event:
Collission with same parent_object:
Thank you for the help!
However whenever two objects collide the game crashes saying "obj_enemy.speedometer not set before reading".
For physical objects that can collide I have created a parent group that detects collissions and reacts. Heres the code for those objects:
Create Event:
Code:
speedometer = ds_list_create();
ds_list_clear(speedometer);
Code:
ds_list_add(speedometer, image_speed)
if ds_list_size(speedometer) >= 3
{
ds_list_delete(speedometer, 0)
}
Code:
with (other)
{
hp -= 1;
}
speed = 0;
motion_add(point_direction(x, y, other.x, other.y), -0.5 * ds_list_read(speedometer, "0", " "));
Thank you for the help!