Kaboom.js also makes good use of JavaScript's support for callbacks instead of writing loops to read in keyboard input and check if game objects have collided (bumped into each other), Kaboom.js uses an event model, where it tells us when such an event has occurred. We'll explore these features and learn how they work by using some of them in our game. It has functionality to draw shapes and sprites (the images of characters and game elements) to the screen, get user input, play sounds, and more. Kaboom.js is a JavaScript library that contains many useful features to make simple in-browser games. Now, give this repl a name, like "snake-kaboom".Īfter the repl has booted up, you should see a main.js file under the "Scenes" section. Log into your Replit account and create a new repl. That's a lot to think about! Let's get started and create a project in Replit.
ON SCREEN SNAKE GAME SERIES
Snake, at its core, is a series of blocks representing a snake moving around a grid, with the player controlling the direction. Let's think a bit about what we need to do. If you don't already have a Replit account, create one now. We'll use the Replit web IDE to create our version of Snake. In this tutorial, we'll implement Snake using Kaboom.js built into Replit It's also a great game to build when you are learning the basics of game making. In the most basic form, it's a super simple game, but still wildly entertaining. At the time, it was often the only game you'd find on a phone. Snake was an incredibly popular game, mostly remembered from 1990s era cell phones. GraphQL part 2: creating a web applicationĬreating interactive Python plots with matplotlib