There's nothing to install and no project to configure. You write one file, press Play, and your code draws onto a canvas immediately. When it's ready, share a link, embed it on a website, or publish a build your friends can play inside Discord.
That's a complete program: a circle that follows your mouse.
AssemblyScript is recommended
AssemblyScript is TypeScript-like syntax that compiles to small, fast WebAssembly. It's the only language that supports Builds and Discord Activities today. If you're not sure which to choose, start here. Compare languages →
#How Codetoy works
- One file. Your whole program lives in a single script. There are no scenes, objects or assets to set up.
- Immediate-mode drawing. Every frame, you clear the canvas and draw what should be on screen. The API is modeled on the HTML
CanvasRenderingContext2D, so if you've drawn on a web canvas, you already know it. - An update loop and events. Codetoy calls your
export function update()Screen.OnUpdate()def update()every frame and notifies you of keyboard, mouse and touch input. - Runs in the browser. Code compiles to WebAssembly (or runs on Pyodide for Python) right in the page.
#Next steps
QuickstartBuild your first interactive codetoy in a few minutes.Choosing a LanguageHow AssemblyScript, C# and Python compare.Program StructureSetup code, the update loop and events.Canvas APIEvery drawing function, with examples.BuildsSave a hosted, playable version of your game.Discord ActivitiesPlay your game with friends in a Discord call.