Game Development Community

Crash upon fish Death (Fish Game Tutorial)

by Sarrene' Grant · in Torque Game Builder · 08/17/2008 (1:42 pm) · 1 replies

Version TGB 1.7.0 (Trial)
Synopsis:
I followed the Fish Game Tutorial included in the TGB Documents. It works fine with no Bugs.
However I decided to add a second "level" called gameover when you die, that allows you to quit or start a new game. The first time you die the gameover level loads fine. After that as long as you die of starvation the gameover level loads also. However if a mine kills you the game crashes. I utilized the Asteroids Game Section 9 to show me how to do the gameover screen, and buttons. It's the oddest thing. The very first death even from a mine is ok, but after that you can not die from a mine or the game will crash.

Any clues/ideas that could help would be greatly appreciated!

Sincerly,
Duston

#1
08/21/2008 (12:55 am)
Nikos Beck answered this (in the private forums) better than I could:

Quote:Try:

SceneWindow2D.schedule(1, loadLevel, "levelname");

The problem is that you're in an object's function and loading the level. But, the object is in the previous level so it's now destroyed. The engine has no idea where that object went and is crashing because the "%this" you were using is now pointing into the middle of nowhere.