The official SDK for writing apps and games for Firefly Zero in Elixir using Orb.
Warning This SDK is highly experimental! The Orb project is in its early alpha testing stage and has a lot of rough edges and missed features. As a consequence, the SDK itself also doesn't implement some of the functions available in other SDKs.
-
Create a new Elixir project:
mix new hello
-
Add the SDK into
mix.exs
:defp deps do [ {:firefly_elixir, "~> 0.1.0"} ] end
-
Fetch dependencies:
mix deps.get
-
Write some code:
defmodule Hello do use Firefly defw boot() do draw_triangle( %Point{x: 60, y: 10}, %Point{x: 40, y: 40}, %Point{x: 80, y: 40}, %Style{fill_color: :light_gray, stroke_color: :dark_blue, stroke_width: 1} ) end end
-
Create
firefly.toml
:author_id = "demo" app_id = "hello" author_name = "Demo" app_name = "Hello" [files] _bin = { path = "main.wasm", copy = true }
-
Build wat:
mix wasm Hello > main.wat
-
Build wasm:
wat2wasm main.wat -o main.wasm
-
Build the Firefly Zero app:
firefly_cli build