Here's the concept that I'm trying to program:
L3(1) contains the player's X coordinate L4(1) contains the player's Y coordinate L1 contains a list of X coordinates of the objects L2 contains a list of Y coordinates of the objects If the player's coordinates match any of the objects coordinates, remove them from L1 and L2
Here's the code I've got:
For(A,1,dim(L1) If (L3(1)=L1(A)) and (L4(1)=L2(A) Then L1(A)→I L2(A)→J L1(dim(L1))→L1(A) L2(dim(L2))→L2(A) dim(L1)→A dim(L1)-1→dim(L1) dim(L2)-1→dim(L2) End End
This algorithm works fine when L1 and L2 are about 5 elements long, but it makes my game lag quite a bit when it is longer. I'm hoping that there's a way to do this without cycling through all of L1's elements. Any ideas?
"Reality is that which, when you stop believing in it, doesn't go away."
-Philip K. Dick