more ecs
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user