Making a pause.

839 views
Skip to first unread message

bumblefish

unread,
Feb 10, 2014, 11:19:02 PM2/10/14
to haxef...@googlegroups.com
First off, sorry for all of the questions. I am pretty new to haxeflixel.
Has anybody successfully implemented a pause for their game?
I have been digging through the library a lot lately. If there is a way built in, I can't find it.
It seems FlxG.vcr.pause will actually pause it, but I can find no way to resume.

Gama11

unread,
Feb 11, 2014, 10:18:26 AM2/11/14
to haxef...@googlegroups.com
FlxG.vcr.pause is not a good solution because it won't be available in FLX_NO_DEBUG.

A very convenient way to pause a game is using a FlxSubState as a pause screen. Opening a substate automatically pauses the current state, closing it unpauses it (by pausing  I mean update() is not being called anymore). 

bumblefish

unread,
Feb 11, 2014, 4:05:25 PM2/11/14
to haxef...@googlegroups.com
Thanks a lot Gama11! I have it working perfect through a substate. You guys have done great on this, and I will keep spreading the word.

Samuel Batista

unread,
Feb 12, 2014, 12:07:17 PM2/12/14
to
Hey there, if your solution is pretty generic it would be a good addition to the engine. It would be cool if we provided a simple "paused" substate that just shows a "Paused" text field, and maybe some volume controls or something.

We would definitely appreciate a pull request with this kind of addition!

Gama11

unread,
Feb 12, 2014, 12:09:58 PM2/12/14
to haxef...@googlegroups.com
We already have the focus lost screen which is pretty much a pause screen. Do you think that should be replaced with that?

Also, similar for volume controls: we have a built-in sound-tray, so having more volume controls on the pause screen seems redundant.


On Wednesday, February 12, 2014 6:07:02 PM UTC+1, Samuel Batista wrote:
Hey there, if your solution is pretty generic it would be a good addition to the engine. It would be cool if we provided a simple "paused" substate that just shows a "Paused" text field, and maybe some volume controls or something.

We would definitely appreciate a pull request with this kind of addition!

On Tuesday, February 11, 2014 4:05:25 PM UTC-5, bumblefish wrote:

Samuel Batista

unread,
Feb 12, 2014, 12:12:29 PM2/12/14
to
It would probably be redundant to duplicate those controls, but we could bring back FlxG.paused as a property, and bring up the focus lost substate or a new paused substate (maybe the users could override the substate class, FlxG.pausedSubState)? I liked having a simple FlxG.paused = true / false;
Reply all
Reply to author
Forward
0 new messages