When you do that, please change the way the points are displayed! Use something like the arcade-text extension to make sprites display the scores instead of the built in system. Also, so sorry about how tedious it is to define levels! To delete the current level you should be able to just do “slots = [ ]” which will basically wipe away all the currently loaded slots.
Also, you will probably need to change the code that draws the slots, because none of them are sprites or anything, they are all drawn on the background image, but if you make the moon into a sprite it will always show up on top of the background image, so it should be fine.
If you want to change the whole background to not be a solid color, you can remove the “let tempImg = image.create(160, 120)” and instead do “let tempImg = img.
” and then edit the image to be whatever you want the background art to be, or you could make a new variable to hold the background image and then set tempImg to be a copy of that other variable every time. (If you do the second option, make sure to use a copy of the image by writing (the image variable).clone)
On line 257 you can change the 2 “12”s to change how far away from the tiles you can click to register clicking a tile.
The bonusPoints function is not really how I want it to work. If you change the playerBonus and opponentBonus to be arrays, you could push the IDs of the slots into them instead of just increasing them.
Then if you check to see if every slot is filled, you can call the function, set currentPlayer to 2, call “animatePoints([opponentBonus])” (wrapping it in another array is necessary), set currentPlayer to 1, and then call “animatePoints([playerBonus])”
Sorry that’s so complicated, I also didn’t write anything that checks if every slot is filled. You could look at the top of the opponentTurn function to see what that code would look like, just putting that into a function and replacing the .push bit with “return false” and then a “return true” after it, so the function will only return true if every slot is filled…
Sorry I’m ranting, you can probably figure all this out yourself, I’m just worried about it my code is readable enough to work with is all. Hope all this helps!!