Building a new game from scratch

If you're comfortable making new web apps from scratch, understand the basic conventions, know how to use npm, etc, then this is the place for you.

1

Ensure all file pathnames are relative

When your game is deployed to Venus, it expects all files to have relative pathnames.

You'll encounter this problem if you use absolute pathnames.

We prefer using vite as a web server and build tool. You can tell Vite to use relative pathnames by putting this line in your vite.config.js:

base: './',
2

Initialize the project with the Venus CLI

cd <project root folder>
venus init
3

Build to a ./dist folder

We also prefer npm for package management and development scripts.

Venus CLI looks for your build in ./dist when uploading to Venus.

You can optionally build to an alternative location, but our tools will look in ./dist by default.

4

Verify that deployment works

Simply run:

venus deploy

If everything is set up correctly, this will return a shareable link, playable by anyone on web or in the Venus app. This link will be unlisted, so don't worry about other people seeing this game on the Venus platform. To make it show in search results on Venus, see publishing instructions.

Our templates include an npm script, npm run deploy, that builds and runs your game. We find it pretty handy, if you want to create a script that simplifies deployment.

Last updated