30 Seconds of Daylight

Saved games stay in this browser only.

About the game

You stand outside a castle whose doors are shut. Somewhere in the grounds around it lies the key, and finding it is the whole job. The grounds are six small areas (the Courtyard, the Outer Gate, the East and West Walls, the Rear Ward and the Secret Gardens) joined by gateways, and every one of them has something in the way.

The game is a turn-based roguelike: nothing moves until you do, and each step takes you one tile. What makes it different is the clock. Daylight lasts thirty seconds, then the world turns orange, then red, and then night falls for another thirty seconds, when the screen goes dark and you only see what is right next to you. Day and night keep alternating until the game is over, so it pays to plan your trips and to know when the dark is coming.

Rats, scorpions, guards, strongmen, ghosts, skeletons, zombies, serpents and witches wander the areas. You fight them by holding an attack key and pressing a direction, and every kill gives experience; when you level up, your health, attack and defence all grow by one. On the ground you can find clubs, swords and axes, wooden, bronze and steel shields, and red potions that bring your health back to full. You have to pick each of them up yourself. A short log at the bottom of the screen tells you what just happened ("You hit the Rat", "Got hit by Scorpion", "You blocked the Guard"). The game ends when you die, or when you reach the castle doors with the key.

30 Seconds of Daylight won the first Pyxel Jam, a game jam for the Pyxel engine, and the author, Adam, later gave the game to the official Pyxel repository as one of its example apps.

Playing it here

The first time you click Play the page downloads Pyxel and the Python runtime (about 15 MB), which takes a few seconds; after that the game shows a "click to start" prompt, and one more click starts it with sound. Nothing is loaded from other sites, and nothing is saved: every run starts from scratch.

On the web we turned off the Esc and Q keys that closed the game on the desktop (and the "Escape to Exit" line of the title screen), because on a web page they would only freeze the screen. To start over, die or open the doors and the game returns to the title screen, or reload the page.

Controls

Input Action
Arrow keys or WASD move one tile
Z or N (hold) + a direction attack the enemy on that side
X or M pick up the item under you (weapon, shield, potion)
Enter start the game from the title screen
Gamepad d-pad, A and B move, attack and pick up, on a connected controller

A few things worth knowing

Watch the clock, not just the map. Thirty seconds is short. Use the daylight to explore and to see where the enemies are, and be ready to fight near what you already know when the screen turns dark.

Gear first. A sword or an axe hits harder than the club, and a shield makes some hits bounce off. Look for them before you go after the tougher monsters.

Keep a potion for later. A red potion restores all your health, so it is worth more when you are low than when you are almost full.

The key opens the way, nothing else. Reaching the castle doors without it only tells you to go and find it.

Frequently asked questions

Is there a save? No. A run is short and starts from the beginning every time.

How do I win? Find the castle key somewhere in the six areas outside the castle and walk into the doors with it.

Does it work on a phone? The game was made for a keyboard or a game pad. The page offers an on-screen pad on touch devices, but we have not tested the game with it.

Why does it say "click to start"? Browsers only allow sound after you interact with the page, so the Pyxel launcher asks for one click before it starts the game.

Is it free? Yes: the game is under the MIT licence and the source of this build is available from this page.

Credits and licence

30 Seconds of Daylight was made by Adam (the author name in the app's header) for the first Pyxel Jam and is distributed in the official Pyxel repository as one of its example apps. The header of the app says it is released under the MIT licence; the licence text and what we changed are in the licence file. The build served here changes two things: the keys that quit the game are turned off, and the "Escape to Exit" line of the title screen is gone. The original app, the patch and the build scripts are hosted alongside the game.

It runs on the Pyxel engine (MIT) and the Pyodide runtime (MPL-2.0), whose licences and source are linked from the Licenses page.