-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
31 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
This is an example null0 cart written in [assemblyscript](https://www.assemblyscript.org/). | ||
|
||
You can make your own by editing files in [src/](src). `npm run build` will build your cart in `build/`. Change the package-name in package.json to change the name of the cart. | ||
|
||
## TODO | ||
|
||
- look into [better build](https://github.com/notnullgames/null0-ideas/blob/main/projects/assemblyscript/tools/build.mjs) | ||
- look into [better cross-plaform build](https://github.com/notnullgames/null0-ideas/blob/main/projects/assemblyscript/tools/build.mjs) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,2 @@ | ||
// include this in your null0 cart | ||
// asc src/index.ts --target release --use trace=_null0_trace --use abort=_null0_abort --use seed=_null0_seed --lib ./null0.ts | ||
|
||
// log a string | ||
@external("null0", "trace") | ||
declare function _null0_real_trace(text: ArrayBuffer): void | ||
|
||
// these are called by language | ||
// https://www.assemblyscript.org/concepts.html#special-imports | ||
// TODO: would WASI help with these? | ||
|
||
export function _null0_trace(message: String): void { | ||
_null0_real_trace(String.UTF8.encode(message, true)); | ||
} | ||
|
||
export function _null0_abort(message: String, fileName: String, line: u32, column: u32): void { | ||
_null0_real_trace(String.UTF8.encode("ABORT: " + message, true)); | ||
} | ||
|
||
export function _null0_seed(): f64 { | ||
return 1.0; | ||
} | ||
// asc --config ./node_modules/@assemblyscript/wasi-shim/asconfig.json --lib ./null0.ts src/main.ts |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
// called when the cart is loaded | ||
export function load(): void { | ||
trace("hello from AS"); | ||
console.log("hello from AS"); | ||
} | ||
|
||
// called on every frame | ||
export function update(): void { | ||
trace("update"); | ||
console.log("update"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
{ | ||
"extends": "assemblyscript/std/assembly.json", | ||
"include": [ | ||
"./**/*.ts" | ||
] | ||
} | ||
"include": ["./src/**/*.ts"] | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters