Code where game turns itself off

Fill this out this info to make it easier for the community to help you! If you don’t fill out this information, your post may be deleted or removed.

What Wick Editor Version are you using?
1.19

Describe the Problem
What issues are you having in the Wick Editor?
I want the game to turn itself off when I press a button

What you can do to “turn off” a game is to either close the window with this code:

window.close();

Or reload the window with this code:

window.location.reload();

Let me know if this isn’t what you meant

just go to a frame and stop it(gotoAndStop(“insert name or number of frame here”)). easy peasy.

if thats not what youre going for, then you can use a clip in a clip and then switch it off when you want to turn the thing off.

finally, you can have two different layers, youll have to stretch out the frame in one, and just simply add the thing in another.

i dont know if you mean “play the game on the 3ds until you hear the sound cue of your mother entering the room” or just “fin”, but hopefully, this should give a good idea on how to do whatever youre trying to do.

The window closing is what I meant. Sorry for the confusion!

1 Like

well then, in that case…

yeah i still dont know. window.close(); probably would work. i think you mean something like:

“He sat and watched. There was nothing he could do. It was too late, the laser was already almost done. It is now virtually impossible to defuse it. So, this is how he was going out. The sky around him started to turn from pink to red, to yellow. So, he sat, and watched, bracing onto the good memories of his past before the aliens blew open the earth’s core from the inside out.”

and then the window closes. yeah, idk anything else that would work other than just a frame with a dark box over it. im no expert in javascript, so there is probably either a better option i just dont see.

Nice story! I’m working on a game where you destroy things and wanted the last level to be “destroying the game” by clicking the power button.

then an explosion gif and then a black screen? im still looking for a way to close the window/tab via javascript. ill still look for an answer though.