Make a Mini Game Popup

Get help using Construct 2

Post » Tue Feb 26, 2013 5:43 pm

I'm new here, but I've been searching and I can't find an answer. Maybe I'm using the wrong terminology in my searches.

Here's the background of my game. It's a simple platformer that has a few levels in it. When the main character dies, they will be presented with a mini game. If they are successful in the mini game, they will be able to continue exactly at the point they died. The mini game would be a full screen scene or level.

I can't figure out how to accomplish this. I don't want to load a new level and lose the current progress and it seems like making a bunch of new layers would be too much overhead, especially for every time the mini game presents itself. I may also want to make different mini games based on progress/level etc.

In Corona SDK they have a modal popup that could load a new scene over the current scene. Is there something similar?
B
3
Posts: 3
Reputation: 331

Post » Tue Feb 26, 2013 5:53 pm

<Head>

<script type="text/javascript">

function popup(){
cuteLittleWindow = window.open("http://localhost:50000/", "littleWindow", "location=no,width=1024,height=1024");
}

</script>

</Head>

<body>

<a href="javascript:popup('red.html')">Here is a popup window.</a>
</body>


Copy and paste that into a text editor, and save it.
Run a game from C2 by pressing F5.
Open up a browser, and drag the file onto the browser to run it.


That is the only way I have found so far. I have no idea how to make it dynamically open up a window like that without user clicking on a link first.

I was going to try had get 2 instances of C2 to communicate, but I have not had the time yet. If you get it working please post how you did it, to save us some time :)

I want to use it as a floating tool pallet for my texture editor I am making.
B
28
S
8
G
4
Posts: 767
Reputation: 5,940

Post » Tue Feb 26, 2013 7:23 pm

That code will open a new pop up window, or does construct block the native behavior?

I basically want to load the mini game level over the current level, basically blocking and pausing the original level. The continuing and dismissing the mini game if successful or going to the game over screen.

Still new to Construct, so I'm not sure exactly what HTML and JS options are available.
B
3
Posts: 3
Reputation: 331

Post » Tue Feb 26, 2013 7:46 pm

@jojoe

Any reason why you wouldn't want to use "onload"? That would certainly allow you to open that link without the need for additional user input.
B
6
S
2
Posts: 206
Reputation: 1,685

Post » Tue Feb 26, 2013 11:48 pm

[QUOTE=Blinx123]
Any reason why you wouldn't want to use "onload"? [/QUOTE]

Just me being a newbie.Thank you very much for the information :) I was racking my brain trying to think of how I could do this.

+1 Karma for you @Blinx123.
B
28
S
8
G
4
Posts: 767
Reputation: 5,940


Return to How do I....?

Who is online

Users browsing this forum: BACLog and 20 guests