Skip to content

kill() command doesn't times #2837

Answered by Geokureli
DarkiCreepKato asked this question in Q&A
Discussion options

You must be logged in to vote

Date.fromTime does not do what you think. You want to use FlxTimers

example:

override public function create()
{
	super.create();
	PinkScreen = new FlxSprite();
	PinkScreen.loadGraphic(AssetPaths.PinkStartGame__png);

	PinkScreen.x = 0;
	PinkScreen.y = 0;
	// wait 2 seconds then add PinkScreen and show it
	new FlxTimer().start(2.0, 
		function(t:FlxTimer)
		{
			add(PinkScreen);
			PinkScreen.visible = true; // note: this line does nothing because visible is true, by default
		}
	);
	// wait 4 seconds then hide it (this will happen 2 seconds after it is first shown)
	new FlxTimer().start(4.0, 
		function(t:FlxTimer)
		{
			PinkScreen.visible = false;
		}
	);
}

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@DarkiCreepKato
Comment options

@Geokureli
Comment options

@DarkiCreepKato
Comment options

@Geokureli
Comment options

Answer selected by DarkiCreepKato
@DarkiCreepKato
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants