mirror of
https://github.com/Keyslam-Group/Concord.git
synced 2025-09-02 12:24:11 -04:00
Merge pull request #25 from jackamo/fix/quick-readme-fixes
README: Fix 'Quick Example' to be runnable
This commit is contained in:
commit
be4a5d9ec7
1 changed files with 5 additions and 5 deletions
10
README.md
10
README.md
|
@ -536,19 +536,19 @@ function MoveSystem:update(dt)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local DrawSystem = Concord.System({Position, Drawable})
|
local DrawSystem = Concord.system({Position, Drawable})
|
||||||
|
|
||||||
function DrawSystem:draw()
|
function DrawSystem:draw()
|
||||||
for _, e in ipairs(self.pool) do
|
for _, e in ipairs(self.pool) do
|
||||||
local position = e[Position]
|
local position = e[Position]
|
||||||
|
|
||||||
love.graphics.circle("fill", position.x, position.y, 5)
|
love.graphics.circle("fill", position.x, position.y, 5)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Create the World
|
-- Create the World
|
||||||
local world = World()
|
local world = Concord.world()
|
||||||
|
|
||||||
-- Add the Systems
|
-- Add the Systems
|
||||||
world:addSystems(MoveSystem, DrawSystem)
|
world:addSystems(MoveSystem, DrawSystem)
|
||||||
|
@ -571,11 +571,11 @@ local entity_3 = Concord.entity(world)
|
||||||
|
|
||||||
-- Emit the events
|
-- Emit the events
|
||||||
function love.update(dt)
|
function love.update(dt)
|
||||||
world:emit(dt)
|
world:emit("update", dt)
|
||||||
end
|
end
|
||||||
|
|
||||||
function love.draw()
|
function love.draw()
|
||||||
world:draw()
|
world:emit("draw")
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue