like turning the clock back to 0 or something like that
because right now i have a situation where i have 2 levels in my game, and the player can select either one in the level selection screen
when i enter say level 1 the first time, its fine
but when i complete or exit the level and try to play level 1 again, the models from the first time dont dissapear
i have tried destroy, removeNode, remove, del, i think most of the things that can remove stuff completely but none have worked
so i am wondering if there is some sort of alternative, like maybe resetting the game when a player has played through the levels
The best way is to just keep track of everything you do and load to do clean up that way. There is another trick, but its a little to powerful for most users. I can’t seem to remember the code, but you can easly find it on the forum some place around here.
render.removeNode() or something like that I think. Like I said, I sorta forgot the command. Its been a while, but its best not to do that.
Best to make one model, then right after make its removeNode() self and move them to another def to be deleted laterd.
This is what I mean by keep track over everything you do.
self.Gun = Loader.load(gun)
self.Gun.removeNode()
def LoadModels(self):
self.Gun = Loader.load(gun)
def ClearUpModels(self):
self.Gun.removeNode()
Also, when you load up all your veriables, just make a singal def that you can recall to “reset” them.
DeleteList = [self.MenuBackGround, self.SettingsButton, self.SoundSettingsButton, self.KeyBoardSettingsButton, self.VideoSettingsButton, self.MainMenuButton, self.ReturnGameButton, self.ExitButton]
for x in DeleteList:
x.removeNode()
If you create a simple node you can attach everything to that node instead of render. Deleting that node should remove all children of it (I think, I just woke up so I am probably wrong )