From 408f436dd184d2c4390b0ed6f4ec747e5fde9e75 Mon Sep 17 00:00:00 2001 From: bakpakin Date: Sun, 22 Mar 2015 12:35:08 +0800 Subject: [PATCH] Change Example --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e54e9e7..09b7564 100644 --- a/README.md +++ b/README.md @@ -47,10 +47,9 @@ local System = jojo.System local personAspect = Aspect({"name", "mass", "phrase"}) local talkingSystem = System( - function (delta) - print("Talking system has started.") - end, + nil, function (p, delta) + p.mass = p.mass + delta * 3 print(p.name .. ", who weighs " .. p.mass .. " pounds, says, \"" .. p.phrase .. "\"") end, personAspect @@ -61,13 +60,15 @@ local world = World(talkingSystem) local joe = { name = "Joe", phrase = "I'm a plumber.", - mass = 250, + mass = 150, hairColor = "brown" } world:add(joe) -world:update(1) +for i = 1, 20 do + world:update(1) +end ``` ## Testing ##