Code is written in Strict mode. Object in list are of custom type.
Here is the code once again:
Here is the code once again:
Method RemoveObjects(all=False) If(all) ClearList(objectsList) Return Else If(deleteTimer._ticks<4) Return For temp=EachIn objectsList If(temp.CollideWithCursor()) ListRemove(objectsList,temp) deleteTimer._ticks=0 soundEngine.PlaySfx("usowanie") Return EndIf Next EndIf End Method Method CollideWithCursor() If(MouseX()>x And MouseX()<x+ImageWidth(brush.bitmap)) If(MouseY()>y And MouseY()<y+ImageHeight(brush.bitmap)) ResetCollisions() CollideImage(brush.bitmap,x,y,0,0,1) If(CollideRect(MouseX(),MouseY(),1,1,1,0)) Return True EndIf EndIf Return False End Method