All pastes #460772 Raw Edit

Unnamed

public lua v1 · immutable
#460772 ·published 2007-04-27 08:27 UTC
rendered paste body
game = {updates = {}, running = false}function game:update ()    self.numupdates = 0    for i, v in pairs(self.updates) do        self.numupdates = self.numupdates + 1        v(self)    endendfunction game:run ()    self.isrunning = true    repeat        self:update()    until self.numupdates == 0    self.isrunning = falseenddo    local times = 10    function game.updates:test ()        print(times)        times = times - 1        if times == 0 then            game.updates.test = nil        end    endendgame:run()--[[10987654321]]