It is normal that after a code change, the world is reset and the actors are lost. You can use the Save the World feature to prevent this: after you have positioned your actors in the world, right-click an empty part of the world background and select Save the World. Then the actors will be put back after each reset/code change.