In the painting game, I'm making u can change colors. I didn't want to stack bitmaps on top of each other so I've decided to replace one bitmap with another If they shape the same coordinates:
I'm deleting the old rectangle, drawing a new one, and assigning it the old one's value in the array.
Now I've checked everything but this problem seems to be here:
After this, my array breaks and stops detecting rectangles correctly.
self(this)["id saved"] is the old rectangles' index
I'm deleting the old rectangle, drawing a new one, and assigning it the old one's value in the array.
Now I've checked everything but this problem seems to be here:
Code:
var bitmap = new Bitmap(816, 624);
bitmap.fillRect(x, y, size, size, color)
var sprite = new Sprite(bitmap);
SceneManager._scene.addChildAt(sprite, self(this)["brush index"])
window.myRectList.splice(self(this)["id saved"], 0, sprite);
After this, my array breaks and stops detecting rectangles correctly.
self(this)["id saved"] is the old rectangles' index