pr 55
This commit is contained in:
@@ -2,5 +2,5 @@
|
||||
"name": "canonical",
|
||||
"version": "0.1.0",
|
||||
"script_fe": "pbs",
|
||||
"entry": "src/main.pbs"
|
||||
"entry": "src/main/modules/main.pbs"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
declare struct Color(raw: bounded)
|
||||
pub declare struct Color(raw: bounded)
|
||||
[[
|
||||
BLACK: Color(0b),
|
||||
WHITE: Color(65535b),
|
||||
@@ -7,6 +7,6 @@ declare struct Color(raw: bounded)
|
||||
BLUE: Color(31b)
|
||||
]]
|
||||
|
||||
declare contract Gfx host {
|
||||
pub declare contract Gfx host {
|
||||
fn clear(color: Color): void;
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
declare struct ButtonState(
|
||||
pub declare struct ButtonState(
|
||||
pressed: bool,
|
||||
released: bool,
|
||||
down: bool,
|
||||
hold_frames: bounded
|
||||
)
|
||||
|
||||
declare struct Pad(
|
||||
pub declare struct Pad(
|
||||
up: ButtonState,
|
||||
down: ButtonState,
|
||||
left: ButtonState,
|
||||
@@ -20,10 +20,6 @@ declare struct Pad(
|
||||
select: ButtonState
|
||||
)
|
||||
|
||||
declare contract Input host {
|
||||
pub declare contract Input host {
|
||||
fn pad(): Pad;
|
||||
}
|
||||
|
||||
fn add(a: int, b: int): int {
|
||||
return a + b;
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
"version": "0.1.0",
|
||||
"script_fe": "pbs",
|
||||
"kind": "app",
|
||||
"entry": "src/main.pbs",
|
||||
"entry": "src/main/modules/main.pbs",
|
||||
"out": "build/program.pbc",
|
||||
"dependencies": {
|
||||
"sdk": "../sdk"
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
import { Color, Gfx, Input } from "@test01:sdk";
|
||||
import { Color, Gfx } from "@sdk:gfx";
|
||||
import { Input } from "@sdk:input";
|
||||
|
||||
fn add(a: int, b: int): int {
|
||||
return a + b;
|
||||
}
|
||||
|
||||
fn frame(): void {
|
||||
// 1. Locals & Arithmetic
|
||||
|
||||
Reference in New Issue
Block a user