*.sublime-project
*.sublime-workspace
src/config.onyx
-*.wasm
\ No newline at end of file
+*.wasm
+lib/
\ No newline at end of file
"label": "Build game",
"type": "shell",
"options": {
- "cwd": "${workspaceFolder}/run_tree"
+ "cwd": "${workspaceFolder}/run_tree",
+ "shell": {
+ "executable": "/bin/sh"
+ }
},
"problemMatcher": "$onyx",
"command": "./run.sh",
- "args": ["build"],
+ // "args": ["build"],
"presentation": {
"echo": true,
"reveal": "silent",
"label": "run",
"type": "shell",
"options": {
- "cwd": "${workspaceFolder}/run_tree"
+ "cwd": "${workspaceFolder}/run_tree",
+ "shell": {
+ "executable": "/bin/sh"
+ }
},
"problemMatcher": "$onyx",
"command": "./run.sh",
--- /dev/null
+[metadata]
+name=bar-game
+description=Bar simulation for MadLads Brewing
+url=
+author=Brendan Hansen
+version=0.0.1
+
+[config]
+lib_source_directory=./lib
+lib_bin_directory=./run_tree/lib
+
+[native_library]
+build_cmd=
+library=
+
+[dependencies]
+git://onyxlang.io/repo/glfw3=0.0.2
+git://onyxlang.io/repo/opengles=0.0.2
+git://onyxlang.io/repo/openal=0.0.2
+git://onyxlang.io/repo/stb_truetype=0.0.2
+git://onyxlang.io/repo/stb_image=0.0.2
+
+[dependency_folders]
+git://onyxlang.io/repo/glfw3=glfw3
+git://onyxlang.io/repo/opengles=opengles
+git://onyxlang.io/repo/openal=openal
+git://onyxlang.io/repo/stb_truetype=stb_truetype
+git://onyxlang.io/repo/stb_image=stb_image
+
case "$1" in
build) shift; onyx -V -I ../src build -o $dest $@ ;;
- run) onyxrun $dest ;;
+ run) onyx-run $dest ;;
*) onyx run -V -I ../src build $@ ;;
esac
\ No newline at end of file
// DEBUG :: true
-#load_path ONYX_PATH
-
#if (package runtime).arch == .X86_64 { #library_path "./lib" }
#if (package runtime).arch == .AARCH64 { #library_path "./lib/aarch64" }
#load_all "./sfx"
#load_all "./utils"
-#load "modules/opengles/module"
-#load "modules/glfw3/module"
-#load "modules/openal/module"
-#load "modules/stb_truetype/module"
-#load "modules/stb_image/module"
+#load "./../lib/opengles/module"
+#load "./../lib/glfw3/module"
+#load "./../lib/openal/module"
+#load "./../lib/stb_truetype/module"
+#load "./../lib/stb_image/module"
+++ /dev/null
-package runtime.vars
-
-
-ONYX_PATH :: ""
\ No newline at end of file
use package core
use package glfw3
-
+#tag Entity_Schematic.{
+ (scene) => wall_create(scene, .{0,0}, .{0,0})
+}
#local Wall :: struct {
render :: (use this: ^Entity) {
r := Entity.get_rect(this);
immediate_rectangle(r.x, r.y, r.w, r.h);
}
-
- #struct_tag Entity_Schematic.{
- (scene) => wall_create(scene, .{0,0}, .{0,0})
- }
}
wall_create :: (scene: ^Scene, pos, size: Vector2) -> ^Entity {
return this;
}
+#tag Entity_Schematic.{create}
#local Door :: struct {
create :: (scene) => door_create(scene, .Zero, .Zero);
door->toggle_open();
}
}
-
- #struct_tag Entity_Schematic.{create}
}
DoorComponent :: struct {
return items[id];
}
+#tag Entity_Schematic.{create}
#local Item_Entity :: struct {
- #struct_tag Entity_Schematic.{create}
create :: (scene) => {
this := scene->make();
}
}
+#tag Entity_Store.Skip
SizeComponent :: struct {
use base: Component;
func : (e: ^Entity) -> Rect;
-
- #struct_tag Entity_Store.Skip
}
+#tag Entity_Store.Skip
InteractableComponent :: struct {
use base: Component;
interact: (e: ^Entity, interactor: ^Entity) -> void;
-
- #struct_tag Entity_Store.Skip
}
Entity :: struct {
// #local background_texture: Texture;
+#tag Entity_Schematic.{ Background.create }
Background :: struct {
- #struct_tag Entity_Schematic.{
- (scene) => {
- this := scene->make();
- this.pos = .{0, 0};
- this.size = .{0, 0};
+ create :: (scene) => {
+ this := scene->make();
+ this.pos = .{0, 0};
+ this.size = .{0, 0};
- scene->modify_component(this, BackgroundComponent) {
- comp.texture_path = "./assets/images/background.png";
- }
-
- return this;
+ scene->modify_component(this, BackgroundComponent) {
+ comp.texture_path = "./assets/images/background.png";
}
+
+ return this;
}
}
use package core
+#tag Entity_Schematic.{ Entryway.create }
Entryway :: struct {
- #struct_tag Entity_Schematic.{
- (scene) => {
- this := scene->make();
- this.size = .{16, 16};
+ create :: (scene) => {
+ this := scene->make();
+ this.size = .{16, 16};
- scene->modify_component(this, SpriteRenderComponent) {
- comp.sprite.sheet = "./assets/images/spritesheet.png";
- comp.sprite.pos = .{0, 0};
- comp.sprite.size = .{16, 16};
- comp.sprite.color = .{1, 1, 1};
- }
-
- scene->modify_component(this, EntrywayComponent) {
- comp.schematic = "Patron";
- comp.spawned_size = .{16, 32};
- }
+ scene->modify_component(this, SpriteRenderComponent) {
+ comp.sprite.sheet = "./assets/images/spritesheet.png";
+ comp.sprite.pos = .{0, 0};
+ comp.sprite.size = .{16, 16};
+ comp.sprite.color = .{1, 1, 1};
+ }
- return this;
+ scene->modify_component(this, EntrywayComponent) {
+ comp.schematic = "Patron";
+ comp.spawned_size = .{16, 32};
}
+
+ return this;
}
}
use package core
+#tag Entity_Schematic.{
+ (scene) => Furniture.create(scene, .{0, 0})
+}
Furniture :: struct {
- #struct_tag Entity_Schematic.{
- (scene) => Furniture.create(scene, .{0, 0})
- }
-
create :: (scene: ^Scene, pos: Vector2) -> ^Entity {
this := scene->make();
this.pos = pos;
use package core
+#tag Entity_Schematic.{
+ (scene) => Patron.create(scene, .{0,0})
+}
Patron :: struct {
- #struct_tag Entity_Schematic.{
- (scene) => Patron.create(scene, .{0,0})
- }
-
create :: (scene: ^Scene, pos: Vector2) -> ^Entity {
this := scene->make();
this.pos = pos;
}
+#tag Entity_Schematic.{
+ (scene: ^Scene) => Player.create(scene, .{0,0})
+}
Player :: struct {
- #struct_tag Entity_Schematic.{
- (scene: ^Scene) => Player.create(scene, .{0,0})
- }
-
create :: (scene: ^Scene, pos: Vector2, controls := player_1_controls) -> ^Entity {
this := scene->make();
this.pos = pos;
+#tag Entity_Schematic.{
+ (scene) => Tap.create(scene, .{0,0}, .{0,0})
+}
Tap :: struct {
- #struct_tag Entity_Schematic.{
- (scene) => Tap.create(scene, .{0,0}, .{0,0})
- }
-
create :: (scene: ^Scene, pos: Vector2, size: Vector2) -> ^Entity {
this := scene->make();
this.pos = pos;
#local hash :: package core.hash
+#tag conv.Custom_Format.{format_vector2i}
+#tag conv.Custom_Parse.{parse_vector2i}
Vector2i :: struct {
x, y: i32;
- #struct_tag conv.Custom_Format.{format_vector2i}
- #struct_tag conv.Custom_Parse.{parse_vector2i}
}
+#tag conv.Custom_Format.{format_vector2}
+#tag conv.Custom_Parse.{parse_vector2}
Vector2 :: struct {
x, y: f32;
Zero :: Vector2.{0, 0}
-
- #struct_tag conv.Custom_Format.{format_vector2}
- #struct_tag conv.Custom_Parse.{parse_vector2}
}
+#tag conv.Custom_Format.{format_vector3i}
Vector3i :: struct {
x, y, z: i32;
- #struct_tag conv.Custom_Format.{format_vector3i}
}
+#tag conv.Custom_Format.{format_vector3}
Vector3 :: struct {
x, y, z: f32;
math.clamp(v.z, min.z, max.z),
};
}
-
- #struct_tag conv.Custom_Format.{format_vector3}
}
#operator + macro (v1, v2: Vector2i) => (typeof v1).{ v1.x + v2.x, v1.y + v2.y };