|
Ok, I have heard of a bunch of people having lag problems in they're games. So I will post up this helpful code for that matter.
For Gamemaker btw.
This code was made by Flipiberke, not me, so don't accuse me of copying his idea. This is in big font so that I can be sure you don't miss it.
This code goes in the step event of the enemies you want it for.
if (x > view_xview[0]-sprite_width) && (x < view_xview[0]+view_wview[0]+sprite_width) { if (activate == false) then hspeed := -1; activate := true; } else { activate := false; hspeed := false; }
This code goes in the creation event of the enemies you want it for.
activate := false
This stops lag and also makes it so that enemies don't move unless in view. We don't want a bunch of enemies falling off cliffs before we get to them now do we?
This post has been edited by serebii911 on Apr 7 2007, 02:02 PM
--------------------
|