So I have a title screen. When the game loads, the title screen tweens in, no problem. If you wait until the title screen is in the right position and press space, the title screen tweens out no problem. The trouble comes when you try to press space before the title screen has moved into position. I’ve done everything I can to avoid this-- see code below. What I was wondering is if anyone has had experience with this and would like to help me out.
Thanks, Taylor Anderson
override public function update():void
{
graphic = new Graphiclist(logo, space, orb)
if (Input.check(Key.SPACE) && !moveIn)
{
sounds.menuTheme.stop();
exit = true;
}
if (moveIn)
{
var sTween:VarTween = new VarTween(Stop)
sTween.tween(logo, "x", logoDest.x, 32, Ease.sineOut)
addTween(sTween)
var oTween:VarTween = new VarTween(Stop);
oTween.tween(orb, "x", orbDest, 32, Ease.sineOut)
addTween(oTween)
var pTween:VarTween = new VarTween(Stop);
pTween.tween(space, "y", spaceDest.y, 32, Ease.sineOut)
addTween(pTween)
}
if (exit && !moveIn)
{
var olTween:VarTween = new VarTween()
olTween.tween(logo, "x", logoExit.x, 32)
addTween(olTween)
var ooTween:VarTween = new VarTween()
ooTween.tween(orb, "x", logoExit.x, 32)
addTween(ooTween)
var opTween:VarTween = new VarTween()
opTween.tween(space, "y", spaceExit.y, 32)
addTween(opTween)
}
if (logo.x <= logoExit.x)
{
FP.world = new GameWorld();
}
}