This commit is contained in:
wooshings
2026-09-30 20:36:42 -07:00
parent 5152eb3f31
commit e75f92ea4b
3 changed files with 20 additions and 12 deletions
+7 -2
View File
@@ -1,6 +1,5 @@
package shoal
import "core:text/table"
import rl "vendor:raylib"
STARTUP := 0
@@ -12,7 +11,7 @@ App :: struct {
update_systems: [dynamic]proc(),
draw_systems: [dynamic]proc(),
plugins: [dynamic]proc(app: ^App),
entities: [dynamic]Entity,
entities: map[int][dynamic]struct{},
}
add_system :: proc(app: ^App, schedule: int, system: proc()) {
@@ -30,6 +29,12 @@ add_plugin :: proc(app: ^App, plugin: proc(app: ^App)) {
append(&app.plugins, plugin)
}
spawn_entity :: proc(app: ^App, components: [dynamic]struct{}) {
entity_len := len(&app.entities)
app.entities[entity_len] = components
}
run :: proc(app: ^App) {
rl.InitWindow(800, 600, "shoal window")
+13 -1
View File
@@ -1,6 +1,18 @@
package shoal
Entity :: struct {
id: i32,
id: int,
components: [dynamic]struct{},
}
spawn_entity :: proc(app: ^App) -> Entity {
entity: Entity
entity_len := len(&app.entities)
entity.id = entity_len
return entity
}
add_collection :: proc(app: ^App, component: $T) {
}
-9
View File
@@ -1,10 +1 @@
package shoal
Query :: struct {
with: [dynamic]struct{},
}
query :: proc(app: ^App, query: Query) {
for e in app.entities {
}
}