Game Creation Workflow
Overview
This skill guides you through creating a new HTML game on the Remix platform.
Prerequisites
- The
REMIX_API_KEYenvironment variable must be set.
Constraints
- The game must target a 2:3 aspect ratio (e.g. 720x1080).
- It must fill the entire viewport at that ratio -- use
width: 100vw; height: 100vhon the game container. No scrollbars, no overflow. - The game must support touch controls as the primary input method (the Remix platform is primarily mobile/touch-based). Keyboard and mouse controls are welcome but optional.
Steps
1. Plan the Game
Decide on the game concept, mechanics, and visual style. Keep scope small -- a single-file HTML game should be playable in under 30 seconds.
2. Write the HTML
Create a single HTML file with inline <style> and <script> tags. Structure:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Game Title</title>
<script src="https://cdn.jsdelivr.net/npm/@remix-gg/sdk@latest/dist/index.min.js"></script>
<style>
/* Game styles can go here */
</style>
</head>
<body>
<!-- Game markup can go here -->
<script>
// Game logic here
</script>
</body>
</html>
Required RemixSDK Functions
-
window.RemixSDK.singlePlayer.actions.gameOver({ score })-- Call when the game ends, passing the player's final score as{ score: number }. This reports the score to the platform. -
window.RemixSDK.onPlayAgain(callback)-- Register a callback (no arguments) that fires when the player requests to play again. The callback should reset game state and restart the game. -
window.RemixSDK.onToggleMute(callback)-- Register a callback that receives{ isMuted: boolean }. The game must mute or unmute all audio based on theisMutedvalue.
3. Validate
Before uploading, read the HTML file and verify:
- Has
<!DOCTYPE html>declaration - Has
<meta name="viewport" ...>tag - Has RemixSDK script tag:
<script src="https://cdn.jsdelivr.net/npm/@remix-gg/sdk@latest/dist/index.min.js"></script> - No legacy
@farcade/game-sdkscript tag - Calls
singlePlayer.actions.gameOver(ORmultiplayer.actions.gameOver((not both) - Registers
.onPlayAgain(callback - Registers
.onToggleMute(callback - No
localStorageorsessionStorageusage - No inline event handlers (
onclick=,onload=, etc.)
Fix any issues before proceeding.
4. Upload the Game
Follow the upload-game workflow to create the game on the Remix platform and deploy your HTML code.
Tips
- Use
requestAnimationFramefor game loops, notsetInterval. - Touch controls are required (primary input); keyboard/mouse are optional extras.
- Keep the total HTML under 100KB for fast loading.