Re Spawning in the same position as you died
by rennie moffat · in Torque Game Builder · 06/17/2009 (11:15 am) · 3 replies
MY tutorial code put this in the onLeveLoaded function of the player.
%this.isDead=false;
%this.startX=%this.getPositionX();
%this.startX=%this.getPositionX();
Why does getPosition appear twice? I thought it would need a Y coordinate if it was twice.
:?
%this.isDead=false;
%this.startX=%this.getPositionX();
%this.startX=%this.getPositionX();
Why does getPosition appear twice? I thought it would need a Y coordinate if it was twice.
:?
About the author
My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.
#2
Looks like it's a typo.
setEnabled() does what it sounds like. Basically, if an object is disabled, then it will not act on any input to it.
schedule() is a timed execution of a function ("spawn"), after a certain number of milliseconds (2000- 2 seconds). You can find out plenty on how to use this in the docs.
06/17/2009 (12:32 pm)
Quote:Why does getPosition appear twice? I thought it would need a Y coordinate if it was twice.
Looks like it's a typo.
setEnabled() does what it sounds like. Basically, if an object is disabled, then it will not act on any input to it.
schedule() is a timed execution of a function ("spawn"), after a certain number of milliseconds (2000- 2 seconds). You can find out plenty on how to use this in the docs.
#3
if you have any insight into another issue if you have time, your response would be most welcome.
If you can, please see this thread.
ren
http://www.garagegames.com/community/forums/viewthread/94701
RE; initialization
06/17/2009 (12:38 pm)
great thank you.if you have any insight into another issue if you have time, your response would be most welcome.
If you can, please see this thread.
ren
http://www.garagegames.com/community/forums/viewthread/94701
RE; initialization
Torque Owner rennie moffat
Renman3000
function BattyPlayer::explode(%this)
{
%this.isDead=true;
%this.setEnabled(false);
%this.schedule(2000, "spawn");
}
I am unsure as to what setEnabled is, as well as schedule and the 2000 proclamation inside.