Skip to content

Flappybird clone written in Magelang language. The motivation of this project is as a proof of concept for Magelang language.

License

Notifications You must be signed in to change notification settings

jauhararifin/flappybird

Repository files navigation

Flappybird

This projects clones the viral Flappy Bird game using WebAssembly and WebGL. It is written in Magelang.

Flappy Bird Screenshot

Compiling

To compile this game, you must first install the Magelang compiler.

  1. Before installing Magelang, make sure you have the following tools installed:

  2. Installing magelang compiler

# At the time of writing this project, Magelang has not been officially released.
# The game was compiled using Magelang with this commit ID: 7b1804beb4d9443a6346c2518652b738e2b90dcb.
# Use this commit ID to install Magelang to ensure version compatibility.
cargo install \
    --git https://github.com/jauhararifin/magelang.git \
    --rev 7b1804beb4d9443a6346c2518652b738e2b90dcb \
    magelang

# Verify the installation
magelang --version
  1. Run the build script
# Clone the flappybird repository
git clone https://github.com/jauhararifin/flappybird.git
cd flappybird

# Execute the build script:
bash ./build.sh

After running this script, you should see a ./build directory in your current working directory, containing all the files required to run the game.

Running

  1. Serve the build directory using an HTTP server. You can use the http-server package from NPM for this purpose.
npx http-server ./build  -p 8800
  1. Open your browser and navigate to http://localhost:8800.

Testing

To run the tests, you'll need to install a WebAssembly runtime called wasmtime. You can follow the installation step on their website. Wasmtime serves as a WebAssembly runtime, similar to JVM for Java and Node.js for JavaScript. There are other alternatives such as WasmEdge, Wasmer, Wasm3, and NodeJs' own WebAssembly runtime. This project uses wasmtime for its ease of installation and use.

Ensure that you've also installed the Magelang compiler as described in the Compiling section.

To execute the tests, simply run bash ./test.sh.

About

Flappybird clone written in Magelang language. The motivation of this project is as a proof of concept for Magelang language.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published