I’m creating a game where objects fall from the sky that the user has to catch with a moveable basket image on the bottom. When the object intersects the basket, the object disappears.
I also give the user the option to replay after the first round (the ViewController with the game is reloaded through a storyboard segue). The problem is that the replay seems to keep an invisible “ghost” image/placeholder of the last spot I left the basket at the last time I played the game.
Somehow, the last position of my basket CGRect frame is being saved. Is there some way I can remove this between each game replay?
Edit: By reloading, I mean after a certain point in the game, I initiate a scene transition (I go from one UIViewController to another). Then, I go back to the original UIViewController after pressing a button.
You missed giving us the code, so this answer can only be a hot shot.
delete the last position of the basket in
-viewWillApear: