L
L1NDHOLM
Guest
What would be the best way to make objects (like enemies and traps) to respawn at their original position if destroyed/left behind AND left outside the view_camera? (like old school NES games).
My current code works like it deactivates everything and activates everything within my view_camera, like this:
But this code is not sufficient anymore.
I'm thinking that all remaining enemies and traps need to be destroyed when they get outside my view_camera view and then somehow respawned and deactivated till i walk back to their original position where they get activated.
Is there a better way? How would i do this?
My current code works like it deactivates everything and activates everything within my view_camera, like this:
Code:
inst_lay_id = layer_get_id("Instances");
instance_deactivate_layer(inst_lay_id);
var cam, cleft, ctop, cw, ch;
cam = view_camera[0];
cleft = camera_get_view_x(cam);
ctop = camera_get_view_y(cam);
cw = camera_get_view_width(cam);
ch = camera_get_view_height(cam);
instance_activate_region(cleft, ctop, cw, ch, true);
I'm thinking that all remaining enemies and traps need to be destroyed when they get outside my view_camera view and then somehow respawned and deactivated till i walk back to their original position where they get activated.
Is there a better way? How would i do this?