Dr_Nomz
Member
SOLUTION: DON'T use Game Maker's built in collision event! xD Just use the step event and try instance_place or place_meeting, that way if you comment it out it will actually STOP running the collision event. Also Pixelated Pope's comment below goes into detail as to why collisions can cause lag.
I don't know why, but for some reason one of my objects seems to take massive amounts of processing power and I have no idea what's causing it.
Basically I just create a bunch of objects that act as a GRID and they can change into other objects that are part of the "grid" for gameplay reasons.
^That's the ENTIRE code for it, here's the water grid:
And for some reason the water works just fine! They're not animated, they're only 50x50 px each. All they do is sit there and do nothing. They share the same parent but it doesn't do anything either. I KNOW it's the land because I tested with 100ish land and 200 ish water, had 600 FPS, changed all the land into water, and it was raised to like 3000! Any idea what's wrong? I can't figure out why it would be doing this at all.
I don't know why, but for some reason one of my objects seems to take massive amounts of processing power and I have no idea what's causing it.
Basically I just create a bunch of objects that act as a GRID and they can change into other objects that are part of the "grid" for gameplay reasons.
GML:
Information about object: obj_Grid_Land
Sprite: spr_Grid_Land
Solid: false
Visible: true
Depth: 5000
Persistent: false
Parent: par_Grid
Children:
Mask:
No Physics Object
Create Event:
execute code:
global.grid_land += 1;
Mouse Event for Left Button:
execute code:
///Debug
/**/
global.grid_land -= 1;
instance_change(obj_Grid_Water,true);
GML:
Information about object: obj_Grid_Water
Sprite: spr_Grid_Water
Solid: false
Visible: true
Depth: 5000
Persistent: false
Parent: par_Grid
Children:
Mask:
No Physics Object
Create Event:
execute code:
global.grid_water += 1;
Collision Event with object obj_Grid_Land:
execute code:
/*with(other){
instance_destroy();
}
Mouse Event for Right Button:
execute code:
///Debug
/**
global.grid_water -= 1;
instance_change(obj_Grid_Land,true);
Last edited: