

This object has the tag "block", which we'll use to give it block-specific behaviors, such as being destroyed by the ball and giving the player points. While components come with prepackaged behaviors, tags are just labels that we can use to define our own behavior.

In this case, we have two components: sprite(), which tells the object which sprite to represent itself with and area(), which gives the object the ability to collide with other objects.

Snake vs block computer touchscreen code#
When you first open your new Kaboom repl, you'll be greeted by a file containing the sample code below.Ī game object definition in Kaboom is a list of components, tags, and custom attributes.Ĭomponents are a core part of Kaboom – they provide different functionality to game objects, from an object's appearance to functionality such as collision detection. Once you've uploaded the files, you can click on the "Kaboom" icon in the sidebar, and return to the "main" code file. Click the "Files" icon on the sidebar and upload everything in the extracted file's Sounds folder to the "sounds" section of your repl, and everything in the Sprites folder to the "sprites" section of your repl.
Snake vs block computer touchscreen zip file#
Download this ZIP file and extract it on your computer. Kaboom repls are quite different from other kinds of repls you may have seen before: instead of dealing directly with files in folders, you'll be dealing with code, sounds and sprites, the latter of which you can draw directly in Replit's image editor.īefore we start coding, we need to upload our sprites and sounds. Give this repl a name, like "blockbreaker". Log into your Replit account and create a new repl. We've created a single ZIP file with the sprites and sounds you will need for this tutorial, which you can download here. We will be using this set of sprites by Michele Bucelli and sound effects from this pack by Jaymin Covy. Have a basic game to build on by adding your own powerups and block types.Use the Kaboom framework to develop a polished arcade game with multiple levels.In this tutorial, we'll use the Kaboom framework to develop a simple block-breaking game, similar to classics like Atari's Breakout and Taito's Arkanoid.īy the end of this tutorial, you'll be able to: Building a block-breaking game with Kaboom.js
