Start typing to search...

Example: Create a game

In this tutorial, you will create a customizable falling objects game, starting from a p5.js game scaffold.

Note
This tutorial assumes you’ve already gone through the Koji quick start tutorial and are familiar with the basics of Koji apps.

Objective

The falling objects game is a simple game where the player tries to collect as many falling objects as they can before they fall off the screen. The player moves their character left or right by clicking anywhere on the screen. The player loses a life when an object falls off the screen, and the game is over when the player runs out of lives.

Here’s an example of the game that you will build in this tutorial.

Sections

fork the game scaffold and modify it to load the images and sounds used in the falling objects game.

define the Player and Collectible classes and spawn them in the game.

enable the player to catch a falling collectible and add the logic for scoring and losing the game.

make the game progressively more difficult over time, so that users have more incentive to compete on the leaderboard.

make the game easily customizable by other people so it can be shared everywhere online.

customize the preview image that is displayed when users share their customized version of the game on social media.

publish your game and share it with your friends, so they can compete for the top leaderboard spot.

Getting help

If you have any questions or feedback about this tutorial, please reach out to @Marko(Svarog) and the Koji community on the Koji Discord server.