Let’s see. Assume first time it runs, x,y is 1,1. So you add Box(1,1).
Next time is run, let’s assume x,y is 2,3. So, enter for loop:
i = 0: Not samex,y, so enterelse, and addBox(2,3).i = 1: Same asx,y(yeah, we just added it), so enterifand removeBox(2,3).
Result: Box added and removed again.
Oh yeah, a debugger would have told you the same thing.
solved I don’t know what’s wrong