Sprig is a tiny construction kit to build tile based games. The games are written in JavaScript. It was made by Hack Club, a global community of teen coders who believe people learn best by making things they care about and sharing them with others. You can watch this video for an introduction to Sprig website. Run games by hitting the Run button or pressing Shift+Enter. Getting Help If this is your first time using Sprig, try playing through the tutorial. From there, we suggest hacking on any of the current games or starting from scratch. If you ever need help, have ideas, or want to meet other game-makers, join the community in the #sprig channel on the Hack Club Slack. You can access this guide here. Level Design Sprig games are made up of grids of square tiles. setLegend(bitmaps) Tell Sprig what types of sprites are available in your game. Bitmap keys must be a single character. We recommend storing character keys in variables. const player = "p" const wall = "w" setLegend( [ player, bitmap`...` ], [ wall, bitmap`...` ], ) To create a new bitmap, type bitmap`.` Those are backticks! Click on the highlighted “bitmap” button to edit your drawing. The order of sprite types in your legend also determines the z-order of drawing them. Sprite types that come first are drawn on top. setBackground(bitmapKey) Tiles a bitmap as the background of the game: setBackground(spriteKey) This only changes the visuals of the game. setMap(level) Designing a level is like drawing a bitmap: map`...` The characters in the map come from the order of your bitmap legend. Levels don’t have to be kept track of in a legend, you should store them in a variable yourself. You can call setMap to clear the game and load a new level: const level = map`...` setMap(level) You might want to keep track of multiple levels using an array to switch between them mid-game: const levels = [ map`...`, map`...`, // etc. ] setMap(levels[0]) // Later: setMap(levels[1]) setSolids(bitmapKey) Solid sprites can’t ov...
First seen: 2025-05-10 17:19
Last seen: 2025-05-10 21:20