Game Maker is a project that explores the use of LLM model to generate code for a simple game using a specialized DSL API. The project is written in ClojureScript and uses shadow-cljs for building. It has no back-end (except for the calls to OpenAI API) and runs entirely in the browser. The game engine used in this project is Babylon.js.
Try out the live demo at https://uds.github.io/game-maker/
To set up the project, follow the steps below:
- Clone the repository to your local machine.
- Open a terminal and navigate to the project directory.
- Run the following command to install the project dependencies:
npm install
TailwindCSS styles can be recompiled manually by running following command:
npm run tailwindcss-dev
or npm run tailwindcss-prod
Note that appropriate tailwindcss-...
task is NOT run automatically by shadow-cljs (e.g. by Calva jack-in).
One should run npm run watch
or npm run release
to rebuild everything.
To ran TailwindCSS compiler in a watch mode while developing:
npm run tailwindcss-watch
To start the Clojure REPL and connect to it using Calva, follow these steps:
- Open Visual Studio Code.
- Open the project directory in Visual Studio Code.
- Install the Calva extension if you haven't already.
- Press
Ctrl+Alt+C
or go to the Command Palette (Ctrl+Shift+P
). - Search for "Calva: Jack-in" and select the appropriate option for your project setup.
- Calva will start the Clojure REPL and connect to it.
The shadow-cljs configuration includes a development HTTP server that listens at the 3000 port.
Once the Calva Jack-in sequence is dine, run the application by opening following URL:
http://localhost:3000
Create canvas surrounded by green walls.
Create a line of 4 yellow bricks at top center of canvas, with interval between bricks is 0.3.
Create red ball in center.
Move yellow bricks to the left by 5.
Create a thin floor plate with size 20 on 20.
Create 50 balls with different color each, floating over the floor at random positions and heights.
Set gravity of Jupiter.
Create two balls.
Create thin bar connecting positions of these balls.
Draw a thin floor of size 30.
Draw a labyrinth of 10 walls on the floor.
Put a green ball on the floor, at the start of the labyrinth.