8000 GitHub - alexiscolin/gnogolf: A 3D mini-golf game on gno.land. The holes live on-chain, and so does the physics: the chain plays every shot. · GitHub
[go: up one dir, main page]

Skip to content
alexiscolinPublic

About

A 3D mini-golf game on gno.land. The holes live on-chain, and so does the physics: the chain plays every shot.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Gnogolf: 3D mini-golf on gno.land

3D mini-golf on the blockchain, where the chain itself rolls the ball.

You pull back, you let go, and a smart contract on gno.land plays the shot with its own physics.
Every score is the chain's own replay of your shots: nobody can forge one, anyone can check it.

Play now at gnogolf.xyz
Free, no wallet needed

The ball sliding across the Garden's ice A rebound off a post on the Mountain A hole in one in Mushroom Town

What's in it

  • Five cups, 90 holes, from the Garden to the Crystal Mines: windmills, trams, a volcano, timed pieces.
  • Weather that turns every five minutes, the same for everyone.
  • Ghost duels: race anyone's best round, stroke for stroke. The chain kept it, so it can't be faked.
  • Boards for every hole and the whole course, and a link that dares a friend to beat you.
  • The Builder: draw a hole, hole it in every weather, publish it under your name.

How it works

The client never sends "I scored 2". It sends what you decided (an angle, a power, the moment you let go), and the golf realm rolls the ball with its own physics. Every score is the chain's replay of your shots, so anyone can check it. Playing is free; keeping a score is one transaction, signed with Adena or gnokey.

The stack

Part Built with
On chain Gno realms and packages: the physics, the hole format, the rules, the records, the gnome collection
In the browser three.js for the 3D (cel shading, no textures), plain TypeScript for the engine, React 19 for the interface on top
The site Next.js 15, a static export: plain files, no server, hosted on Netlify
The aim line the realm's own Go code built with TinyGo to wasm, checked against the chain byte for byte
Wallets Adena, or a gnokey command to paste
Checks Gno tests with gas and storage goldens, node:test, strict TypeScript, ESLint, goldens for every gnome and every scene

Getting started

You need Go, Node 22.15 or later, and a gnolang/gno checkout next to this repo.

Build the onyx toolchain once (onyx runs mainnet's code):

t=${GNO_TOOLCHAIN:-${XDG_CACHE_HOME:-$HOME/.cache}/gno-toolchains/onyx}
git -C ../gno worktree add ../gno-onyx chain/onyx
(cd ../gno-onyx/gnovm && go build -o $t/gno ./cmd/gno)
(cd ../gno-onyx/gno.land && go build -o $t/gnokey ./cmd/gnokey)
(cd ../gno-onyx/contribs/gnodev && go build -o $t/gnodev .)

Then play the whole game on your machine:

cd web && npm ci && cd ..
scripts/try-local.sh     # a local chain with the 90 holes, two wallets, the site

It prints the link to open and the wallets to import in Adena.

Commands

check

cd web
npm run dev              # the game on http://localhost:3000, against a local gnodev
npm run build            # the static site in web/out
npm test                 # the unit tests

cd ..
scripts/check.sh         # everything that must pass before a commit
SKIP_GNO=1 scripts/check.sh   # the client alone, as the CI runs it

Project structure

gno.land/p/gnogolf/   the physics and the hole format, reusable by any Gno game
gno.land/r/gnogolf/   the realms: golf (the rules), store (the records), gnomes, and the 90 holes
web/lib/              the game: engine, 3D scene, Builder, chain client; no React
web/components/       the interface
data/                 the 90 holes as published, and the gnome catalogue
scripts/              checks, deploys, the local playground, end-to-end runs

Each of these folders has a README that says where to start.

Learn more

About

A 3D mini-golf game on gno.land. The holes live on-chain, and so does the physics: the chain plays every shot.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0