project screenshot 1
project screenshot 2
project screenshot 3

SwayCue

A Billiards Simulator Written in Sway With Elastic Collisions

SwayCue

Created At

ETHSanFrancisco 2022

Project Description

The project is intended to be a simulator for playing a billiards game on-chain. Before actually creating a billiards game that users can play against each other, I needed to actually build the entire framework for creating the game...from placing the balls and obstacles to handling all the trigonometry involved with elastic collision.

This was no easy task, but I think I've put on display what can be possible for a physics engine on-chain. I hope you will enjoy the effort I have put into this project!

How it's Made

This project was written in Sway (i.e. Fuel's native language). Having to write almost 1000 lines of code meant that I could basically only write the smart contract and library code needed to build a billiards game. I hope this will serve as inspiration for future developers to build on top of! Really excited for this :)

background image mobile

Join the mailing list

Get the latest news and updates