local min, max, huge = math.min, math.max, math.huge local machine = {state = {}} machine.counters = { ["@is [move up] down?"] = 0, ["@clear screen"] = 0, ["@present"] = 0, ["@is [move left] down?"] = 0, ["@sleep"] = 0, ["@ms"] = 0, ["@is [move down] down?"] = 0, ["clear @circle index"] = 0, ["@is [move right] down?"] = 0, ["@event quit"] = 0, ["@shoot bullet"] = 0, ["clear the screen"] = 0, ["circle count => iteration"] = 0, ["copied circle count"] = 0, ["get random number"] = 0, ["copy circle count to iteration"] = 0, ["next cycle"] = 0, ["@number -> @new circle x"] = 0, ["draw each circle"] = 0, ["draw circles"] = 0, ["@number -> @new circle y"] = 0, ["print fps"] = 0, ["@delete out of bounds bullets"] = 0, ["@number -> @new circle r"] = 0, ["@number -> @new circle speed"] = 0, ["@number -> @new circle x:9007199254740991"] = 0, ["move each circle"] = 0, ["@number -> @new circle y:9007199254740991"] = 0, ["@number -> @new circle r:9007199254740991"] = 0, ["@draw bullets"] = 0, ["@number -> @new circle speed:9007199254740991"] = 0, ["generate x position"] = 0, ["@random min:25"] = 0, ["@update spawn timer"] = 0, ["@random max:775"] = 0, ["generate radius"] = 0, ["updating scene"] = 0, ["@make the timer faster"] = 0, ["@random min:1"] = 0, ["clear @circle index:9007199254740991"] = 0, ["@random max:3"] = 0, ["@random min:2"] = 0, ["@random max:5"] = 0, ["circle count => iteration:9007199254740991"] = 0, ["@exit code"] = 0, ["make circles:100"] = 0, ["@do player collisions"] = 0, ["sleep for 1ms"] = 0, ["present current frame"] = 0, ["draw scene"] = 0, ["@event keyreleased"] = 0, ["@event keypressed"] = 0, ["@event mousemoved"] = 0, ["update scene state"] = 0, ["step timer"] = 0, ["@event mousepressed"] = 0, ["run current frame"] = 0, ["handle input"] = 0, ["poll input"] = 0, ["start polling inputs"] = 0, ["run main loop"] = 1, ["reset timer"] = 0, ["make the timer faster"] = 0, ["@new circle"] = 0, ["spawn a zombie"] = 0, ["draw zombies"] = 0, ["@new circle x"] = 0, ["handling input"] = 0, ["@new circle y"] = 0, ["reset @circle index"] = 0, ["@new circle r"] = 0, ["update circles"] = 0, ["@new circle speed"] = 0, ["move player"] = 0, ["iteration"] = 0, ["circle count"] = 0, ["make circle"] = 0, ["make new circle"] = 0, ["generate speed"] = 0, ["generate y position"] = 0, ["move @number to @new circle speed"] = 0, ["move @number to @new circle r"] = 0, ["@draw circle"] = 0, ["move @number to @new circle y"] = 0, ["move @number to @new circle x"] = 0, ["moving player"] = 0, ["@circle index"] = 0, ["move bullets"] = 0, ["handling inputs"] = 0, ["move zombies"] = 0, ["shoot bullet"] = 0, ["check for collisions"] = 0, ["spawn 100 circles"] = 0, ["check for player hit by zombie"] = 0, ["@move circle"] = 0, ["check for bullet hitting zombie"] = 0, ["draw bullets"] = 0, ["update spawn timer"] = 0, ["draw player"] = 0, ["@spawn timer expired"] = 0, ["@get random number"] = 0, ["@number -> @new circle x:35322350018592"] = 0, ["@number -> @new circle x:146565767712"] = 0, ["@number -> @new circle x:654311463"] = 0, ["@number -> @new circle x:6745479"] = 0, ["@number -> @new circle x:172961"] = 0, ["@number -> @new circle x:678"] = 0, ["@number -> @new circle x:3"] = 0, ["@number -> @new circle x:1"] = 0, ["@number -> @new circle y:35322350018592"] = 0, ["@number"] = 0, ["@number -> @new circle y:654311463"] = 0, ["@draw zombies"] = 0, ["print key pressed"] = 0, ["@number -> @new circle y:172961"] = 0, ["@number -> @new circle y:678"] = 0, ["@number -> @new circle y:3"] = 0, ["@spawn a zombie"] = 0, ["@random max:1"] = 0, ["@number -> @new circle r:35322350018592"] = 0, ["@number -> @new circle r:146565767712"] = 0, ["@number -> @new circle r:654311463"] = 0, ["@number -> @new circle r:6745479"] = 0, ["@number -> @new circle r:172961"] = 0, ["@number -> @new circle r:678"] = 0, ["@number -> @new circle r:3"] = 0, ["@number -> @new circle r:1"] = 0, ["@number -> @new circle speed:35322350018592"] = 0, ["@number -> @new circle speed:146565767712"] = 0, ["@number -> @new circle speed:654311463"] = 0, ["@number -> @new circle speed:6745479"] = 0, ["@number -> @new circle speed:172961"] = 0, ["@number -> @new circle speed:678"] = 0, ["@number -> @new circle speed:3"] = 0, ["@number -> @new circle speed:1"] = 0, ["make circles:1"] = 0, ["circle count => iteration:35322350018592"] = 0, ["circle count => iteration:146565767712"] = 0, ["circle count => iteration:654311463"] = 0, ["circle count => iteration:6745479"] = 0, ["circle count => iteration:172961"] = 0, ["circle count => iteration:678"] = 0, ["circle count => iteration:3"] = 0, ["circle count => iteration:1"] = 0, ["clear @circle index:35322350018592"] = 0, ["clear @circle index:146565767712"] = 0, ["clear @circle index:654311463"] = 0, ["clear @circle index:6745479"] = 0, ["clear @circle index:172961"] = 0, ["clear @circle index:678"] = 0, ["clear @circle index:3"] = 0, ["clear @circle index:1"] = 0, ["drawing scene"] = 0, ["make circles"] = 0, ["sweep deleted entities"] = 0, ["@once"] = 1, ["@no events left"] = 0, ["@[move up] is down"] = 0, ["@print key pressed"] = 0, ["@random min"] = 0, ["@[move down] is down"] = 0, ["@random max"] = 0, ["@number -> @new circle y:1"] = 0, ["@number -> @new circle y:6745479"] = 0, ["@start polling"] = 0, ["@reset timer"] = 0, ["@move bullets"] = 0, ["@draw player"] = 0, ["@do bullet collisions"] = 0, ["@move zombies"] = 0, ["@number -> @new circle y:146565767712"] = 0, ["@poll input"] = 0, ["@move player"] = 0, ["@[move right] is down"] = 0, ["@dir up"] = 0, ["@[move left] is down"] = 0, ["@dir down"] = 0, ["@quit love"] = 0, ["@dir left"] = 0, ["@save key pressed"] = 0, ["@dir right"] = 0, ["@print fps"] = 0, ["@delete killed zombies"] = 0, ["@step timer"] = 0, ["@random max:575"] = 0, } machine.state = { ["circles"] = {}, ["last_key_pressed"] = "", ["player"] = {x = 400, y = 300, r = 10, health = 5}, ["event_args"] = {}, ["bullets"] = {}, ["dt"] = 0, ["zombies"] = {}, ["spawn_timer"] = { time_left = 1, duration = 1 }, ["default_font"] = love.graphics.getFont(), ["large_font"] = love.graphics.newFont(64), } function machine:on_new_circle(counters, new_circle_x, new_circle_y, new_circle_r, new_circle_speed) table.insert(self.state.circles, { x = new_circle_x , y = new_circle_y , r = new_circle_r , speed = new_circle_speed , t = 0 } ) end function machine:on_draw_circle(counters, circle_index) local circle = self.state.circles[circle_index] local ox, oy = math.cos(circle.speed * circle.t + circle_index), math.sin(circle.speed * circle.t + circle_index) love.graphics.circle("fill", circle.x + 5 * ox , circle.y + 5 * oy , circle.r) end function machine:on_move_circle(counters, circle_index) local circle = self.state.circles[circle_index] circle.t = circle.t + self.state.dt end function machine:on_get_random_number(counters, random_min, random_max) counters["@number"] = math.random(random_min, random_max) end function machine:on_print_fps(counters) love.graphics.setColor(1, 0, 0) love.graphics.print( tostring(love.timer.getFPS()) .. " bullets: " .. tostring(#self.state.bullets) .. " zombies: " .. tostring(#self.state.zombies) , 10, 10) love.graphics.setColor(1, 1, 1) end function machine:on_save_key_pressed(counters) self.state.last_key_pressed = self.state.event_args[1] end function machine:on_print_key_pressed(counters) love.graphics.setFont(self.state.large_font) local key = self.state.last_key_pressed local width, height = self.state.large_font:getWidth(key), self.state.large_font:getHeight(key) love.graphics.setColor(0, 0, 0) love.graphics.print(key, 400 - width / 2 + 5, 300 - height / 2 + 5) love.graphics.setColor(1, 0, 0) love.graphics.print(key, 400 - width / 2, 300 - height / 2) love.graphics.setColor(1, 1, 1) end function machine:on_print_fps(counters) love.graphics.setColor(1, 0, 0) love.graphics.print( tostring(love.timer.getFPS()) .. " bullets: " .. tostring(#self.state.bullets) .. " zombies: " .. tostring(#self.state.zombies) , 10, 10) love.graphics.setColor(1, 1, 1) end function machine:on_draw_player(counters) local player = self.state.player love.graphics.setColor(0, 1, 0) love.graphics.circle("fill", player.x, player.y, player.r) love.graphics.setColor(1, 1, 1) end function machine:on_move_player(counters, dir_up, dir_down, dir_left, dir_right) local player = self.state.player local dir_y = (dir_down - dir_up) local dir_x = (dir_right - dir_left) player.x = player.x + dir_x * self.state.dt * 300 player.y = player.y + dir_y * self.state.dt * 300 end function machine:on_is_move_up_down(counters) if love.keyboard.isDown("w") then counters["@[move up] is down"] = 1 end end function machine:on_is_move_left_down(counters) if love.keyboard.isDown("a") then counters["@[move left] is down"] = 1 end end function machine:on_is_move_down_down(counters) if love.keyboard.isDown("s") then counters["@[move down] is down"] = 1 end end function machine:on_is_move_right_down(counters) if love.keyboard.isDown("d") then counters["@[move right] is down"] = 1 end end function machine:on_shoot_bullet(counters) local bullets = self.state.bullets local px, py = self.state.player.x, self.state.player.y local mx, my = love.mouse.getPosition() local angle = math.atan2(my - py, mx - px) table.insert(bullets, {x = px, y = py, angle = angle, r = 5}) end function machine:on_move_bullets(counters) local dt = self.state.dt local bullets = self.state.bullets for _, bullet in ipairs(bullets) do bullet.x = bullet.x + math.cos(bullet.angle) * 350 * dt bullet.y = bullet.y + math.sin(bullet.angle) * 350 * dt local in_bounds = -10 <= bullet.x and bullet.x <= 810 and -10 <= bullet.y and bullet.y <= 610 if not in_bounds then bullet.deleted = true end end end function machine:on_delete_bullets(counters) local bullets = self.state.bullets local survivers = {} for _, bullet in ipairs(bullets) do if not bullet.deleted then table.insert(survivers, bullet) end end self.state.bullets = survivers end function machine:on_draw_bullets(counters) local bullets = self.state.bullets for _, bullet in ipairs(bullets) do love.graphics.setColor(1, 1, 0) love.graphics.circle("fill", bullet.x, bullet.y, bullet.r) love.graphics.setColor(1, 1, 1) end end function machine:on_update_spawn_timer(counters) local spawn_timer = self.state.spawn_timer spawn_timer.time_left = spawn_timer.time_left - self.state.dt if 0 >= spawn_timer.time_left then counters["@spawn timer expired"] = 1 end end function machine:on_make_the_timer_faster(counters) local spawn_timer = self.state.spawn_timer spawn_timer.duration = spawn_timer.duration - 0.0125 end function machine:on_reset_timer(counters) local spawn_timer = self.state.spawn_timer spawn_timer.time_left = spawn_timer.duration end function machine:on_draw_zombies(counters) local zombies = self.state.zombies for _, zombie in ipairs(zombies) do love.graphics.setColor(1, 0, 0) love.graphics.circle("fill", zombie.x, zombie.y, zombie.r) love.graphics.setColor(1, 0, 0) end end function machine:on_spawn_a_zombie(counters) local angle = math.random() * math.pi * 2 local x, y = math.cos(angle) * 450 + 400, math.sin(angle) * 350 + 300 table.insert(self.state.zombies, {x = x, y = y, health = 2, r = 10}) end function machine:on_delete_killed_zombies(counters) local zombies = self.state.zombies local survivers = {} for _, zombie in ipairs(zombies) do if not zombie.dead then table.insert(survivers, zombie) end end self.state.zombies = survivers end function machine:on_move_zombies(counters) local player = self.state.player local zombies = self.state.zombies for _, zombie in ipairs(zombies) do local angle = math.atan2(player.y - zombie.y, player.x - zombie.x) zombie.x = zombie.x + self.state.dt * math.cos(angle) * 310 zombie.y = zombie.y + self.state.dt * math.sin(angle) * 310 end end function machine:on_do_bullet_collisions(counters) local bullets = self.state.bullets local zombies = self.state.zombies for _, bullet in ipairs(bullets) do if bullet.deleted then goto next_bullet end for _, zombie in ipairs(zombies) do if zombie.dead then goto next_zombie end local min_distance = bullet.r + zombie.r local distance = math.sqrt((bullet.x - zombie.x) ^ 2 + (bullet.y - zombie.y) ^ 2) if distance < min_distance then zombie.health = zombie.health - 1 if zombie.health < 0 then zombie.dead = true end bullet.deleted = true end ::next_zombie:: end ::next_bullet:: end end function machine:on_start_polling(counters) love.event.pump() self.state.event_iter = love.event.poll() end function machine:on_poll_input(counters) local name, a, b, c, d, e, f = self.state.event_iter() if name then local counter = "@event " .. name if counters[counter] then counters[counter] = 1 self.state.event_args[1] = a self.state.event_args[2] = b self.state.event_args[3] = c self.state.event_args[4] = d self.state.event_args[5] = e self.state.event_args[6] = f end else counters["@no events left"] = 1 end end function machine:on_quit_love(counters) counters["@exit code"] = self.state.event_args[1] or 0 end function machine:on_step_timer(counters) self.state.dt = love.timer.step() end function machine:on_clear_screen(counters) love.graphics.origin() love.graphics.clear(love.graphics.getBackgroundColor()) end function machine:on_present(counters) love.graphics.present() end function machine:on_sleep(counters, ms) love.timer.sleep(ms / 1000) end function match(self, counters) if counters["@new circle"] > 0 then self:on_new_circle(counters, counters["@new circle x"], counters["@new circle y"], counters["@new circle r"], counters["@new circle speed"]) counters["@new circle"] = 0 counters["@new circle x"] = 0 counters["@new circle y"] = 0 counters["@new circle r"] = 0 counters["@new circle speed"] = 0 return true end if counters["@draw circle"] > 0 then self:on_draw_circle(counters, counters["@circle index"]) counters["@draw circle"] = 0 return true end if counters["@move circle"] > 0 then self:on_move_circle(counters, counters["@circle index"]) counters["@move circle"] = 0 return true end if counters["@get random number"] > 0 then counters["@number"] = 0 self:on_get_random_number(counters, counters["@random min"], counters["@random max"]) counters["@get random number"] = 0 counters["@random min"] = 0 counters["@random max"] = 0 return true end if counters["@print fps"] > 0 then self:on_print_fps(counters) counters["@print fps"] = 0 return true end if counters["@save key pressed"] > 0 then self:on_save_key_pressed(counters) counters["@save key pressed"] = 0 return true end if counters["@print key pressed"] > 0 then self:on_print_key_pressed(counters) counters["@print key pressed"] = 0 return true end if counters["@print fps"] > 0 then self:on_print_fps(counters) counters["@print fps"] = 0 return true end if counters["@draw player"] > 0 then self:on_draw_player(counters) counters["@draw player"] = 0 return true end if counters["@move player"] > 0 then self:on_move_player(counters, counters["@dir up"], counters["@dir down"], counters["@dir left"], counters["@dir right"]) counters["@move player"] = 0 counters["@dir up"] = 0 counters["@dir down"] = 0 counters["@dir left"] = 0 counters["@dir right"] = 0 return true end if counters["@is [move up] down?"] > 0 then counters["@[move up] is down"] = 0 self:on_is_move_up_down(counters) counters["@is [move up] down?"] = 0 return true end if counters["@is [move left] down?"] > 0 then counters["@[move left] is down"] = 0 self:on_is_move_left_down(counters) counters["@is [move left] down?"] = 0 return true end if counters["@is [move down] down?"] > 0 then counters["@[move down] is down"] = 0 self:on_is_move_down_down(counters) counters["@is [move down] down?"] = 0 return true end if counters["@is [move right] down?"] > 0 then counters["@[move right] is down"] = 0 self:on_is_move_right_down(counters) counters["@is [move right] down?"] = 0 return true end if counters["@shoot bullet"] > 0 then self:on_shoot_bullet(counters) counters["@shoot bullet"] = 0 return true end if counters["@move bullets"] > 0 then self:on_move_bullets(counters) counters["@move bullets"] = 0 return true end if counters["@delete out of bounds bullets"] > 0 then self:on_delete_bullets(counters) counters["@delete out of bounds bullets"] = 0 return true end if counters["@draw bullets"] > 0 then self:on_draw_bullets(counters) counters["@draw bullets"] = 0 return true end if counters["@update spawn timer"] > 0 then counters["@spawn timer expired"] = 0 self:on_update_spawn_timer(counters) counters["@update spawn timer"] = 0 return true end if counters["@make the timer faster"] > 0 then self:on_make_the_timer_faster(counters) counters["@make the timer faster"] = 0 return true end if counters["@reset timer"] > 0 then self:on_reset_timer(counters) counters["@reset timer"] = 0 return true end if counters["@draw zombies"] > 0 then self:on_draw_zombies(counters) counters["@draw zombies"] = 0 return true end if counters["@spawn a zombie"] > 0 then self:on_spawn_a_zombie(counters) counters["@spawn a zombie"] = 0 return true end if counters["@delete killed zombies"] > 0 then self:on_delete_killed_zombies(counters) counters["@delete killed zombies"] = 0 return true end if counters["@move zombies"] > 0 then self:on_move_zombies(counters) counters["@move zombies"] = 0 return true end if counters["@do bullet collisions"] > 0 then self:on_do_bullet_collisions(counters) counters["@do bullet collisions"] = 0 return true end if counters["@start polling"] > 0 then self:on_start_polling(counters) counters["@start polling"] = 0 return true end if counters["@poll input"] > 0 then counters["@event keypressed"] = 0 counters["@event keyreleased"] = 0 counters["@event mousemoved"] = 0 counters["@event mousepressed"] = 0 counters["@no events left"] = 0 self:on_poll_input(counters) counters["@poll input"] = 0 return true end if counters["@quit love"] > 0 then counters["@exit code"] = 0 self:on_quit_love(counters) counters["@quit love"] = 0 return true end if counters["@step timer"] > 0 then self:on_step_timer(counters) counters["@step timer"] = 0 return true end if counters["@clear screen"] > 0 then self:on_clear_screen(counters) counters["@clear screen"] = 0 return true end if counters["@present"] > 0 then self:on_present(counters) counters["@present"] = 0 return true end if counters["@sleep"] > 0 then self:on_sleep(counters, counters["@ms"]) counters["@sleep"] = 0 counters["@ms"] = 0 return true end if counters["@number -> @new circle x:9007199254740991"] > 0 then local acc = counters["@number -> @new circle x:9007199254740991"] counters["@number -> @new circle x:9007199254740991"] = max(counters["@number -> @new circle x:9007199254740991"] - acc, 0) counters["@number -> @new circle x:35322350018592"] = counters["@number -> @new circle x:35322350018592"] + acc * 255 counters["@number -> @new circle x"] = counters["@number -> @new circle x"] + acc * 31 return true end if counters["@number -> @new circle x:35322350018592"] > 0 then local acc = counters["@number -> @new circle x:35322350018592"] counters["@number -> @new circle x:35322350018592"] = max(counters["@number -> @new circle x:35322350018592"] - acc, 0) counters["@number -> @new circle x:146565767712"] = counters["@number -> @new circle x:146565767712"] + acc * 241 return true end if counters["@number -> @new circle x:146565767712"] > 0 then local acc = counters["@number -> @new circle x:146565767712"] counters["@number -> @new circle x:146565767712"] = max(counters["@number -> @new circle x:146565767712"] - acc, 0) counters["@number -> @new circle x:654311463"] = counters["@number -> @new circle x:654311463"] + acc * 224 return true end if counters["@number -> @new circle x:654311463"] > 0 then local acc = counters["@number -> @new circle x:654311463"] counters["@number -> @new circle x:654311463"] = max(counters["@number -> @new circle x:654311463"] - acc, 0) counters["@number -> @new circle x:6745479"] = counters["@number -> @new circle x:6745479"] + acc * 97 return true end if counters["@number -> @new circle x:6745479"] > 0 then local acc = counters["@number -> @new circle x:6745479"] counters["@number -> @new circle x:6745479"] = max(counters["@number -> @new circle x:6745479"] - acc, 0) counters["@number -> @new circle x:172961"] = counters["@number -> @new circle x:172961"] + acc * 39 return true end if counters["@number -> @new circle x:172961"] > 0 then local acc = counters["@number -> @new circle x:172961"] counters["@number -> @new circle x:172961"] = max(counters["@number -> @new circle x:172961"] - acc, 0) counters["@number -> @new circle x"] = counters["@number -> @new circle x"] + acc * 71 counters["@number -> @new circle x:678"] = counters["@number -> @new circle x:678"] + acc * 255 return true end if counters["@number -> @new circle x:678"] > 0 then local acc = counters["@number -> @new circle x:678"] counters["@number -> @new circle x:678"] = max(counters["@number -> @new circle x:678"] - acc, 0) counters["@number -> @new circle x:3"] = counters["@number -> @new circle x:3"] + acc * 226 return true end if counters["@number -> @new circle x:3"] > 0 then local acc = counters["@number -> @new circle x:3"] counters["@number -> @new circle x:3"] = max(counters["@number -> @new circle x:3"] - acc, 0) counters["@number -> @new circle x:1"] = counters["@number -> @new circle x:1"] + acc * 3 return true end if counters["@number -> @new circle x:1"] > 0 then local acc = counters["@number -> @new circle x:1"] counters["@number -> @new circle x:1"] = max(counters["@number -> @new circle x:1"] - acc, 0) counters["@number -> @new circle x"] = counters["@number -> @new circle x"] + acc * 1 return true end if counters["@random min:1"] > 0 then local acc = counters["@random min:1"] counters["@random min:1"] = max(counters["@random min:1"] - acc, 0) counters["@random min"] = counters["@random min"] + acc * 1 return true end if counters["@number -> @new circle y:9007199254740991"] > 0 then local acc = counters["@number -> @new circle y:9007199254740991"] counters["@number -> @new circle y:9007199254740991"] = max(counters["@number -> @new circle y:9007199254740991"] - acc, 0) counters["@number -> @new circle y:35322350018592"] = counters["@number -> @new circle y:35322350018592"] + acc * 255 counters["@number -> @new circle y"] = counters["@number -> @new circle y"] + acc * 31 return true end if counters["@number -> @new circle y:35322350018592"] > 0 then local acc = counters["@number -> @new circle y:35322350018592"] counters["@number -> @new circle y:35322350018592"] = max(counters["@number -> @new circle y:35322350018592"] - acc, 0) counters["@number -> @new circle y:146565767712"] = counters["@number -> @new circle y:146565767712"] + acc * 241 return true end if counters["@number -> @new circle y:146565767712"] > 0 then local acc = counters["@number -> @new circle y:146565767712"] counters["@number -> @new circle y:146565767712"] = max(counters["@number -> @new circle y:146565767712"] - acc, 0) counters["@number -> @new circle y:654311463"] = counters["@number -> @new circle y:654311463"] + acc * 224 return true end if counters["@number -> @new circle y:654311463"] > 0 then local acc = counters["@number -> @new circle y:654311463"] counters["@number -> @new circle y:654311463"] = max(counters["@number -> @new circle y:654311463"] - acc, 0) counters["@number -> @new circle y:6745479"] = counters["@number -> @new circle y:6745479"] + acc * 97 return true end if counters["@number -> @new circle y:6745479"] > 0 then local acc = counters["@number -> @new circle y:6745479"] counters["@number -> @new circle y:6745479"] = max(counters["@number -> @new circle y:6745479"] - acc, 0) counters["@number -> @new circle y:172961"] = counters["@number -> @new circle y:172961"] + acc * 39 return true end if counters["@number -> @new circle y:172961"] > 0 then local acc = counters["@number -> @new circle y:172961"] counters["@number -> @new circle y:172961"] = max(counters["@number -> @new circle y:172961"] - acc, 0) counters["@number -> @new circle y:678"] = counters["@number -> @new circle y:678"] + acc * 255 counters["@number -> @new circle y"] = counters["@number -> @new circle y"] + acc * 71 return true end if counters["@number -> @new circle y:678"] > 0 then local acc = counters["@number -> @new circle y:678"] counters["@number -> @new circle y:678"] = max(counters["@number -> @new circle y:678"] - acc, 0) counters["@number -> @new circle y:3"] = counters["@number -> @new circle y:3"] + acc * 226 return true end if counters["@number -> @new circle y:3"] > 0 then local acc = counters["@number -> @new circle y:3"] counters["@number -> @new circle y:3"] = max(counters["@number -> @new circle y:3"] - acc, 0) counters["@number -> @new circle y:1"] = counters["@number -> @new circle y:1"] + acc * 3 return true end if counters["@number -> @new circle y:1"] > 0 then local acc = counters["@number -> @new circle y:1"] counters["@number -> @new circle y:1"] = max(counters["@number -> @new circle y:1"] - acc, 0) counters["@number -> @new circle y"] = counters["@number -> @new circle y"] + acc * 1 return true end if counters["@random max:3"] > 0 then local acc = counters["@random max:3"] counters["@random max:3"] = max(counters["@random max:3"] - acc, 0) counters["@random max:1"] = counters["@random max:1"] + acc * 3 return true end if counters["@random max:1"] > 0 then local acc = counters["@random max:1"] counters["@random max:1"] = max(counters["@random max:1"] - acc, 0) counters["@random max"] = counters["@random max"] + acc * 1 return true end if counters["@number -> @new circle r:9007199254740991"] > 0 then local acc = counters["@number -> @new circle r:9007199254740991"] counters["@number -> @new circle r:9007199254740991"] = max(counters["@number -> @new circle r:9007199254740991"] - acc, 0) counters["@number -> @new circle r:35322350018592"] = counters["@number -> @new circle r:35322350018592"] + acc * 255 counters["@number -> @new circle r"] = counters["@number -> @new circle r"] + acc * 31 return true end if counters["@number -> @new circle r:35322350018592"] > 0 then local acc = counters["@number -> @new circle r:35322350018592"] counters["@number -> @new circle r:35322350018592"] = max(counters["@number -> @new circle r:35322350018592"] - acc, 0) counters["@number -> @new circle r:146565767712"] = counters["@number -> @new circle r:146565767712"] + acc * 241 return true end if counters["@number -> @new circle r:146565767712"] > 0 then local acc = counters["@number -> @new circle r:146565767712"] counters["@number -> @new circle r:146565767712"] = max(counters["@number -> @new circle r:146565767712"] - acc, 0) counters["@number -> @new circle r:654311463"] = counters["@number -> @new circle r:654311463"] + acc * 224 return true end if counters["@number -> @new circle r:654311463"] > 0 then local acc = counters["@number -> @new circle r:654311463"] counters["@number -> @new circle r:654311463"] = max(counters["@number -> @new circle r:654311463"] - acc, 0) counters["@number -> @new circle r:6745479"] = counters["@number -> @new circle r:6745479"] + acc * 97 return true end if counters["@number -> @new circle r:6745479"] > 0 then local acc = counters["@number -> @new circle r:6745479"] counters["@number -> @new circle r:6745479"] = max(counters["@number -> @new circle r:6745479"] - acc, 0) counters["@number -> @new circle r:172961"] = counters["@number -> @new circle r:172961"] + acc * 39 return true end if counters["@number -> @new circle r:172961"] > 0 then local acc = counters["@number -> @new circle r:172961"] counters["@number -> @new circle r:172961"] = max(counters["@number -> @new circle r:172961"] - acc, 0) counters["@number -> @new circle r"] = counters["@number -> @new circle r"] + acc * 71 counters["@number -> @new circle r:678"] = counters["@number -> @new circle r:678"] + acc * 255 return true end if counters["@number -> @new circle r:678"] > 0 then local acc = counters["@number -> @new circle r:678"] counters["@number -> @new circle r:678"] = max(counters["@number -> @new circle r:678"] - acc, 0) counters["@number -> @new circle r:3"] = counters["@number -> @new circle r:3"] + acc * 226 return true end if counters["@number -> @new circle r:3"] > 0 then local acc = counters["@number -> @new circle r:3"] counters["@number -> @new circle r:3"] = max(counters["@number -> @new circle r:3"] - acc, 0) counters["@number -> @new circle r:1"] = counters["@number -> @new circle r:1"] + acc * 3 return true end if counters["@number -> @new circle r:1"] > 0 then local acc = counters["@number -> @new circle r:1"] counters["@number -> @new circle r:1"] = max(counters["@number -> @new circle r:1"] - acc, 0) counters["@number -> @new circle r"] = counters["@number -> @new circle r"] + acc * 1 return true end if counters["@number -> @new circle speed:9007199254740991"] > 0 then local acc = counters["@number -> @new circle speed:9007199254740991"] counters["@number -> @new circle speed:9007199254740991"] = max(counters["@number -> @new circle speed:9007199254740991"] - acc, 0) counters["@number -> @new circle speed:35322350018592"] = counters["@number -> @new circle speed:35322350018592"] + acc * 255 counters["@number -> @new circle speed"] = counters["@number -> @new circle speed"] + acc * 31 return true end if counters["@number -> @new circle speed:35322350018592"] > 0 then local acc = counters["@number -> @new circle speed:35322350018592"] counters["@number -> @new circle speed:35322350018592"] = max(counters["@number -> @new circle speed:35322350018592"] - acc, 0) counters["@number -> @new circle speed:146565767712"] = counters["@number -> @new circle speed:146565767712"] + acc * 241 return true end if counters["@number -> @new circle speed:146565767712"] > 0 then local acc = counters["@number -> @new circle speed:146565767712"] counters["@number -> @new circle speed:146565767712"] = max(counters["@number -> @new circle speed:146565767712"] - acc, 0) counters["@number -> @new circle speed:654311463"] = counters["@number -> @new circle speed:654311463"] + acc * 224 return true end if counters["@number -> @new circle speed:654311463"] > 0 then local acc = counters["@number -> @new circle speed:654311463"] counters["@number -> @new circle speed:654311463"] = max(counters["@number -> @new circle speed:654311463"] - acc, 0) counters["@number -> @new circle speed:6745479"] = counters["@number -> @new circle speed:6745479"] + acc * 97 return true end if counters["@number -> @new circle speed:6745479"] > 0 then local acc = counters["@number -> @new circle speed:6745479"] counters["@number -> @new circle speed:6745479"] = max(counters["@number -> @new circle speed:6745479"] - acc, 0) counters["@number -> @new circle speed:172961"] = counters["@number -> @new circle speed:172961"] + acc * 39 return true end if counters["@number -> @new circle speed:172961"] > 0 then local acc = counters["@number -> @new circle speed:172961"] counters["@number -> @new circle speed:172961"] = max(counters["@number -> @new circle speed:172961"] - acc, 0) counters["@number -> @new circle speed"] = counters["@number -> @new circle speed"] + acc * 71 counters["@number -> @new circle speed:678"] = counters["@number -> @new circle speed:678"] + acc * 255 return true end if counters["@number -> @new circle speed:678"] > 0 then local acc = counters["@number -> @new circle speed:678"] counters["@number -> @new circle speed:678"] = max(counters["@number -> @new circle speed:678"] - acc, 0) counters["@number -> @new circle speed:3"] = counters["@number -> @new circle speed:3"] + acc * 226 return true end if counters["@number -> @new circle speed:3"] > 0 then local acc = counters["@number -> @new circle speed:3"] counters["@number -> @new circle speed:3"] = max(counters["@number -> @new circle speed:3"] - acc, 0) counters["@number -> @new circle speed:1"] = counters["@number -> @new circle speed:1"] + acc * 3 return true end if counters["@number -> @new circle speed:1"] > 0 then local acc = counters["@number -> @new circle speed:1"] counters["@number -> @new circle speed:1"] = max(counters["@number -> @new circle speed:1"] - acc, 0) counters["@number -> @new circle speed"] = counters["@number -> @new circle speed"] + acc * 1 return true end if counters["make circles:100"] > 0 then local acc = counters["make circles:100"] counters["make circles:100"] = max(counters["make circles:100"] - acc, 0) counters["make circles:1"] = counters["make circles:1"] + acc * 100 return true end if counters["make circles:1"] > 0 then local acc = counters["make circles:1"] counters["make circles:1"] = max(counters["make circles:1"] - acc, 0) counters["make circles"] = counters["make circles"] + acc * 1 return true end if counters["@random max:5"] > 0 then local acc = counters["@random max:5"] counters["@random max:5"] = max(counters["@random max:5"] - acc, 0) counters["@random max:1"] = counters["@random max:1"] + acc * 5 return true end if counters["@random max:1"] > 0 then local acc = counters["@random max:1"] counters["@random max:1"] = max(counters["@random max:1"] - acc, 0) counters["@random max"] = counters["@random max"] + acc * 1 return true end if counters["@random min:25"] > 0 then local acc = counters["@random min:25"] counters["@random min:25"] = max(counters["@random min:25"] - acc, 0) counters["@random min:1"] = counters["@random min:1"] + acc * 25 return true end if counters["@random min:1"] > 0 then local acc = counters["@random min:1"] counters["@random min:1"] = max(counters["@random min:1"] - acc, 0) counters["@random min"] = counters["@random min"] + acc * 1 return true end if counters["circle count => iteration:9007199254740991"] > 0 then local acc = counters["circle count => iteration:9007199254740991"] counters["circle count => iteration:9007199254740991"] = max(counters["circle count => iteration:9007199254740991"] - acc, 0) counters["circle count => iteration"] = counters["circle count => iteration"] + acc * 31 counters["circle count => iteration:35322350018592"] = counters["circle count => iteration:35322350018592"] + acc * 255 return true end if counters["circle count => iteration:35322350018592"] > 0 then local acc = counters["circle count => iteration:35322350018592"] counters["circle count => iteration:35322350018592"] = max(counters["circle count => iteration:35322350018592"] - acc, 0) counters["circle count => iteration:146565767712"] = counters["circle count => iteration:146565767712"] + acc * 241 return true end if counters["circle count => iteration:146565767712"] > 0 then local acc = counters["circle count => iteration:146565767712"] counters["circle count => iteration:146565767712"] = max(counters["circle count => iteration:146565767712"] - acc, 0) counters["circle count => iteration:654311463"] = counters["circle count => iteration:654311463"] + acc * 224 return true end if counters["circle count => iteration:654311463"] > 0 then local acc = counters["circle count => iteration:654311463"] counters["circle count => iteration:654311463"] = max(counters["circle count => iteration:654311463"] - acc, 0) counters["circle count => iteration:6745479"] = counters["circle count => iteration:6745479"] + acc * 97 return true end if counters["circle count => iteration:6745479"] > 0 then local acc = counters["circle count => iteration:6745479"] counters["circle count => iteration:6745479"] = max(counters["circle count => iteration:6745479"] - acc, 0) counters["circle count => iteration:172961"] = counters["circle count => iteration:172961"] + acc * 39 return true end if counters["circle count => iteration:172961"] > 0 then local acc = counters["circle count => iteration:172961"] counters["circle count => iteration:172961"] = max(counters["circle count => iteration:172961"] - acc, 0) counters["circle count => iteration:678"] = counters["circle count => iteration:678"] + acc * 255 counters["circle count => iteration"] = counters["circle count => iteration"] + acc * 71 return true end if counters["circle count => iteration:678"] > 0 then local acc = counters["circle count => iteration:678"] counters["circle count => iteration:678"] = max(counters["circle count => iteration:678"] - acc, 0) counters["circle count => iteration:3"] = counters["circle count => iteration:3"] + acc * 226 return true end if counters["circle count => iteration:3"] > 0 then local acc = counters["circle count => iteration:3"] counters["circle count => iteration:3"] = max(counters["circle count => iteration:3"] - acc, 0) counters["circle count => iteration:1"] = counters["circle count => iteration:1"] + acc * 3 return true end if counters["circle count => iteration:1"] > 0 then local acc = counters["circle count => iteration:1"] counters["circle count => iteration:1"] = max(counters["circle count => iteration:1"] - acc, 0) counters["circle count => iteration"] = counters["circle count => iteration"] + acc * 1 return true end if counters["@random max:775"] > 0 then local acc = counters["@random max:775"] counters["@random max:775"] = max(counters["@random max:775"] - acc, 0) counters["@random max:5"] = counters["@random max:5"] + acc * 155 return true end if counters["@random max:5"] > 0 then local acc = counters["@random max:5"] counters["@random max:5"] = max(counters["@random max:5"] - acc, 0) counters["@random max:1"] = counters["@random max:1"] + acc * 5 return true end if counters["@random max:1"] > 0 then local acc = counters["@random max:1"] counters["@random max:1"] = max(counters["@random max:1"] - acc, 0) counters["@random max"] = counters["@random max"] + acc * 1 return true end if counters["@random min:2"] > 0 then local acc = counters["@random min:2"] counters["@random min:2"] = max(counters["@random min:2"] - acc, 0) counters["@random min:1"] = counters["@random min:1"] + acc * 2 return true end if counters["@random min:1"] > 0 then local acc = counters["@random min:1"] counters["@random min:1"] = max(counters["@random min:1"] - acc, 0) counters["@random min"] = counters["@random min"] + acc * 1 return true end if counters["clear @circle index:9007199254740991"] > 0 then local acc = counters["clear @circle index:9007199254740991"] counters["clear @circle index:9007199254740991"] = max(counters["clear @circle index:9007199254740991"] - acc, 0) counters["clear @circle index"] = counters["clear @circle index"] + acc * 31 counters["clear @circle index:35322350018592"] = counters["clear @circle index:35322350018592"] + acc * 255 return true end if counters["clear @circle index:35322350018592"] > 0 then local acc = counters["clear @circle index:35322350018592"] counters["clear @circle index:35322350018592"] = max(counters["clear @circle index:35322350018592"] - acc, 0) counters["clear @circle index:146565767712"] = counters["clear @circle index:146565767712"] + acc * 241 return true end if counters["clear @circle index:146565767712"] > 0 then local acc = counters["clear @circle index:146565767712"] counters["clear @circle index:146565767712"] = max(counters["clear @circle index:146565767712"] - acc, 0) counters["clear @circle index:654311463"] = counters["clear @circle index:654311463"] + acc * 224 return true end if counters["clear @circle index:654311463"] > 0 then local acc = counters["clear @circle index:654311463"] counters["clear @circle index:654311463"] = max(counters["clear @circle index:654311463"] - acc, 0) counters["clear @circle index:6745479"] = counters["clear @circle index:6745479"] + acc * 97 return true end if counters["clear @circle index:6745479"] > 0 then local acc = counters["clear @circle index:6745479"] counters["clear @circle index:6745479"] = max(counters["clear @circle index:6745479"] - acc, 0) counters["clear @circle index:172961"] = counters["clear @circle index:172961"] + acc * 39 return true end if counters["clear @circle index:172961"] > 0 then local acc = counters["clear @circle index:172961"] counters["clear @circle index:172961"] = max(counters["clear @circle index:172961"] - acc, 0) counters["clear @circle index:678"] = counters["clear @circle index:678"] + acc * 255 counters["clear @circle index"] = counters["clear @circle index"] + acc * 71 return true end if counters["clear @circle index:678"] > 0 then local acc = counters["clear @circle index:678"] counters["clear @circle index:678"] = max(counters["clear @circle index:678"] - acc, 0) counters["clear @circle index:3"] = counters["clear @circle index:3"] + acc * 226 return true end if counters["clear @circle index:3"] > 0 then local acc = counters["clear @circle index:3"] counters["clear @circle index:3"] = max(counters["clear @circle index:3"] - acc, 0) counters["clear @circle index:1"] = counters["clear @circle index:1"] + acc * 3 return true end if counters["clear @circle index:1"] > 0 then local acc = counters["clear @circle index:1"] counters["clear @circle index:1"] = max(counters["clear @circle index:1"] - acc, 0) counters["clear @circle index"] = counters["clear @circle index"] + acc * 1 return true end if counters["@random max:575"] > 0 then local acc = counters["@random max:575"] counters["@random max:575"] = max(counters["@random max:575"] - acc, 0) counters["@random max:5"] = counters["@random max:5"] + acc * 115 return true end if counters["@random max:5"] > 0 then local acc = counters["@random max:5"] counters["@random max:5"] = max(counters["@random max:5"] - acc, 0) counters["@random max:1"] = counters["@random max:1"] + acc * 5 return true end if counters["@random max:1"] > 0 then local acc = counters["@random max:1"] counters["@random max:1"] = max(counters["@random max:1"] - acc, 0) counters["@random max"] = counters["@random max"] + acc * 1 return true end if counters["updating scene"] > 0 then local acc = counters["updating scene"] counters["updating scene"] = max(counters["updating scene"] - acc, 0) counters["move player"] = counters["move player"] + acc * 1 counters["check for collisions"] = counters["check for collisions"] + acc * 1 counters["update circles"] = counters["update circles"] + acc * 1 counters["sweep deleted entities"] = counters["sweep deleted entities"] + acc * 1 counters["update spawn timer"] = counters["update spawn timer"] + acc * 1 counters["move bullets"] = counters["move bullets"] + acc * 1 counters["move zombies"] = counters["move zombies"] + acc * 1 return true end if counters["drawing scene"] > 0 then local acc = counters["drawing scene"] counters["drawing scene"] = max(counters["drawing scene"] - acc, 0) counters["draw player"] = counters["draw player"] + acc * 1 counters["print fps"] = counters["print fps"] + acc * 1 counters["draw zombies"] = counters["draw zombies"] + acc * 1 counters["print key pressed"] = counters["print key pressed"] + acc * 1 counters["draw bullets"] = counters["draw bullets"] + acc * 1 counters["draw circles"] = counters["draw circles"] + acc * 1 return true end if counters["handling input"] > 0 and counters["@event keypressed"] > 0 then local acc = huge acc = min(acc, counters["@event keypressed"]) acc = min(acc, counters["handling input"]) counters["handling input"] = max(counters["handling input"] - acc, 0) counters["@event keypressed"] = max(counters["@event keypressed"] - acc, 0) counters["@save key pressed"] = counters["@save key pressed"] + acc * 1 counters["handling input"] = counters["handling input"] + acc * 1 counters["spawn 100 circles"] = counters["spawn 100 circles"] + acc * 1 return true end if counters["handling input"] > 0 and counters["@event mousepressed"] > 0 then local acc = huge acc = min(acc, counters["@event mousepressed"]) acc = min(acc, counters["handling input"]) counters["handling input"] = max(counters["handling input"] - acc, 0) counters["@event mousepressed"] = max(counters["@event mousepressed"] - acc, 0) counters["shoot bullet"] = counters["shoot bullet"] + acc * 1 counters["handling inputs"] = counters["handling inputs"] + acc * 1 return true end if counters["clear @circle index"] > 0 and counters["@circle index"] > 0 then local acc = huge acc = min(acc, counters["@circle index"]) acc = min(acc, counters["clear @circle index"]) counters["clear @circle index"] = max(counters["clear @circle index"] - acc, 0) counters["@circle index"] = max(counters["@circle index"] - acc, 0) counters["clear @circle index"] = counters["clear @circle index"] + acc * 1 return true end if counters["clear @circle index"] > 0 then local acc = counters["clear @circle index"] counters["clear @circle index"] = max(counters["clear @circle index"] - acc, 0) return true end if counters["reset @circle index"] > 0 then local acc = counters["reset @circle index"] counters["reset @circle index"] = max(counters["reset @circle index"] - acc, 0) counters["clear @circle index:9007199254740991"] = counters["clear @circle index:9007199254740991"] + acc * 1 return true end if counters["get random number"] > 0 then local acc = counters["get random number"] counters["get random number"] = max(counters["get random number"] - acc, 0) counters["@get random number"] = counters["@get random number"] + acc * 1 return true end if counters["@number -> @new circle x"] > 0 and counters["@number"] > 0 then local acc = huge acc = min(acc, counters["@number"]) acc = min(acc, counters["@number -> @new circle x"]) counters["@number -> @new circle x"] = max(counters["@number -> @new circle x"] - acc, 0) counters["@number"] = max(counters["@number"] - acc, 0) counters["@new circle x"] = counters["@new circle x"] + acc * 1 counters["@number -> @new circle x"] = counters["@number -> @new circle x"] + acc * 1 return true end if counters["@number -> @new circle x"] > 0 then local acc = counters["@number -> @new circle x"] counters["@number -> @new circle x"] = max(counters["@number -> @new circle x"] - acc, 0) return true end if counters["@number -> @new circle y"] > 0 and counters["@number"] > 0 then local acc = huge acc = min(acc, counters["@number -> @new circle y"]) acc = min(acc, counters["@number"]) counters["@number -> @new circle y"] = max(counters["@number -> @new circle y"] - acc, 0) counters["@number"] = max(counters["@number"] - acc, 0) counters["@number -> @new circle y"] = counters["@number -> @new circle y"] + acc * 1 counters["@new circle y"] = counters["@new circle y"] + acc * 1 return true end if counters["@number -> @new circle y"] > 0 then local acc = counters["@number -> @new circle y"] counters["@number -> @new circle y"] = max(counters["@number -> @new circle y"] - acc, 0) return true end if counters["@number -> @new circle r"] > 0 and counters["@number"] > 0 then local acc = huge acc = min(acc, counters["@number"]) acc = min(acc, counters["@number -> @new circle r"]) counters["@number -> @new circle r"] = max(counters["@number -> @new circle r"] - acc, 0) counters["@number"] = max(counters["@number"] - acc, 0) counters["@new circle r"] = counters["@new circle r"] + acc * 1 counters["@number -> @new circle r"] = counters["@number -> @new circle r"] + acc * 1 return true end if counters["@number -> @new circle r"] > 0 then local acc = counters["@number -> @new circle r"] counters["@number -> @new circle r"] = max(counters["@number -> @new circle r"] - acc, 0) return true end if counters["@number -> @new circle speed"] > 0 and counters["@number"] > 0 then local acc = huge acc = min(acc, counters["@number -> @new circle speed"]) acc = min(acc, counters["@number"]) counters["@number -> @new circle speed"] = max(counters["@number -> @new circle speed"] - acc, 0) counters["@number"] = max(counters["@number"] - acc, 0) counters["@number -> @new circle speed"] = counters["@number -> @new circle speed"] + acc * 1 counters["@new circle speed"] = counters["@new circle speed"] + acc * 1 return true end if counters["@number -> @new circle speed"] > 0 then local acc = counters["@number -> @new circle speed"] counters["@number -> @new circle speed"] = max(counters["@number -> @new circle speed"] - acc, 0) return true end if counters["move @number to @new circle x"] > 0 then local acc = counters["move @number to @new circle x"] counters["move @number to @new circle x"] = max(counters["move @number to @new circle x"] - acc, 0) counters["@number -> @new circle x:9007199254740991"] = counters["@number -> @new circle x:9007199254740991"] + acc * 1 return true end if counters["move @number to @new circle y"] > 0 then local acc = counters["move @number to @new circle y"] counters["move @number to @new circle y"] = max(counters["move @number to @new circle y"] - acc, 0) counters["@number -> @new circle y:9007199254740991"] = counters["@number -> @new circle y:9007199254740991"] + acc * 1 return true end if counters["move @number to @new circle r"] > 0 then local acc = counters["move @number to @new circle r"] counters["move @number to @new circle r"] = max(counters["move @number to @new circle r"] - acc, 0) counters["@number -> @new circle r:9007199254740991"] = counters["@number -> @new circle r:9007199254740991"] + acc * 1 return true end if counters["move @number to @new circle speed"] > 0 then local acc = counters["move @number to @new circle speed"] counters["move @number to @new circle speed"] = max(counters["move @number to @new circle speed"] - acc, 0) counters["@number -> @new circle speed:9007199254740991"] = counters["@number -> @new circle speed:9007199254740991"] + acc * 1 return true end if counters["generate x position"] > 0 then local acc = counters["generate x position"] counters["generate x position"] = max(counters["generate x position"] - acc, 0) counters["@random max:775"] = counters["@random max:775"] + acc * 1 counters["move @number to @new circle x"] = counters["move @number to @new circle x"] + acc * 1 counters["@random min:25"] = counters["@random min:25"] + acc * 1 counters["get random number"] = counters["get random number"] + acc * 1 return true end if counters["generate y position"] > 0 then local acc = counters["generate y position"] counters["generate y position"] = max(counters["generate y position"] - acc, 0) counters["move @number to @new circle y"] = counters["move @number to @new circle y"] + acc * 1 counters["@random max:575"] = counters["@random max:575"] + acc * 1 counters["@random min:25"] = counters["@random min:25"] + acc * 1 counters["get random number"] = counters["get random number"] + acc * 1 return true end if counters["generate radius"] > 0 then local acc = counters["generate radius"] counters["generate radius"] = max(counters["generate radius"] - acc, 0) counters["@random max:3"] = counters["@random max:3"] + acc * 1 counters["move @number to @new circle r"] = counters["move @number to @new circle r"] + acc * 1 counters["@random min:1"] = counters["@random min:1"] + acc * 1 counters["get random number"] = counters["get random number"] + acc * 1 return true end if counters["generate speed"] > 0 then local acc = counters["generate speed"] counters["generate speed"] = max(counters["generate speed"] - acc, 0) counters["move @number to @new circle speed"] = counters["move @number to @new circle speed"] + acc * 1 counters["@random max:5"] = counters["@random max:5"] + acc * 1 counters["get random number"] = counters["get random number"] + acc * 1 counters["@random min:2"] = counters["@random min:2"] + acc * 1 return true end if counters["make new circle"] > 0 then local acc = counters["make new circle"] counters["make new circle"] = max(counters["make new circle"] - acc, 0) counters["@new circle"] = counters["@new circle"] + acc * 1 return true end if counters["make circle"] > 0 then local acc = counters["make circle"] counters["make circle"] = max(counters["make circle"] - acc, 0) counters["generate x position"] = counters["generate x position"] + acc * 1 counters["generate y position"] = counters["generate y position"] + acc * 1 counters["generate radius"] = counters["generate radius"] + acc * 1 counters["make new circle"] = counters["make new circle"] + acc * 1 counters["generate speed"] = counters["generate speed"] + acc * 1 return true end if counters["circle count => iteration"] > 0 and counters["circle count"] > 0 then local acc = huge acc = min(acc, counters["circle count"]) acc = min(acc, counters["circle count => iteration"]) counters["circle count => iteration"] = max(counters["circle count => iteration"] - acc, 0) counters["circle count"] = max(counters["circle count"] - acc, 0) counters["iteration"] = counters["iteration"] + acc * 1 counters["copied circle count"] = counters["copied circle count"] + acc * 1 return true end if counters["circle count => iteration"] > 0 then local acc = counters["circle count => iteration"] counters["circle count => iteration"] = max(counters["circle count => iteration"] - acc, 0) return true end if counters["copied circle count"] > 0 then local acc = counters["copied circle count"] counters["copied circle count"] = max(counters["copied circle count"] - acc, 0) counters["circle count"] = counters["circle count"] + acc * 1 return true end if counters["copy circle count to iteration"] > 0 then local acc = counters["copy circle count to iteration"] counters["copy circle count to iteration"] = max(counters["copy circle count to iteration"] - acc, 0) counters["circle count => iteration:9007199254740991"] = counters["circle count => iteration:9007199254740991"] + acc * 1 return true end if counters["draw each circle"] > 0 and counters["iteration"] > 0 then local acc = huge acc = min(acc, counters["draw each circle"]) acc = min(acc, counters["iteration"]) counters["draw each circle"] = max(counters["draw each circle"] - acc, 0) counters["iteration"] = max(counters["iteration"] - acc, 0) counters["draw each circle"] = counters["draw each circle"] + acc * 1 counters["@draw circle"] = counters["@draw circle"] + acc * 1 counters["@circle index"] = counters["@circle index"] + acc * 1 return true end if counters["draw each circle"] > 0 then local acc = counters["draw each circle"] counters["draw each circle"] = max(counters["draw each circle"] - acc, 0) return true end if counters["draw circles"] > 0 then local acc = counters["draw circles"] counters["draw circles"] = max(counters["draw circles"] - acc, 0) counters["copy circle count to iteration"] = counters["copy circle count to iteration"] + acc * 1 counters["reset @circle index"] = counters["reset @circle index"] + acc * 1 counters["draw each circle"] = counters["draw each circle"] + acc * 1 return true end if counters["print fps"] > 0 then local acc = counters["print fps"] counters["print fps"] = max(counters["print fps"] - acc, 0) counters["@print fps"] = counters["@print fps"] + acc * 1 return true end if counters["print key pressed"] > 0 then local acc = counters["print key pressed"] counters["print key pressed"] = max(counters["print key pressed"] - acc, 0) counters["@print key pressed"] = counters["@print key pressed"] + acc * 1 return true end if counters["drawing scene"] > 0 then local acc = counters["drawing scene"] counters["drawing scene"] = max(counters["drawing scene"] - acc, 0) counters["draw circles"] = counters["draw circles"] + acc * 1 counters["print key pressed"] = counters["print key pressed"] + acc * 1 counters["print fps"] = counters["print fps"] + acc * 1 return true end if counters["move each circle"] > 0 and counters["iteration"] > 0 then local acc = huge acc = min(acc, counters["move each circle"]) acc = min(acc, counters["iteration"]) counters["move each circle"] = max(counters["move each circle"] - acc, 0) counters["iteration"] = max(counters["iteration"] - acc, 0) counters["@move circle"] = counters["@move circle"] + acc * 1 counters["move each circle"] = counters["move each circle"] + acc * 1 counters["@circle index"] = counters["@circle index"] + acc * 1 return true end if counters["move each circle"] > 0 then local acc = counters["move each circle"] counters["move each circle"] = max(counters["move each circle"] - acc, 0) return true end if counters["update circles"] > 0 then local acc = counters["update circles"] counters["update circles"] = max(counters["update circles"] - acc, 0) counters["copy circle count to iteration"] = counters["copy circle count to iteration"] + acc * 1 counters["reset @circle index"] = counters["reset @circle index"] + acc * 1 counters["move each circle"] = counters["move each circle"] + acc * 1 return true end if counters["updating scene"] > 0 then local acc = counters["updating scene"] counters["updating scene"] = max(counters["updating scene"] - acc, 0) counters["update circles"] = counters["update circles"] + acc * 1 return true end if counters["handling input"] > 0 and counters["@event keypressed"] > 0 then local acc = huge acc = min(acc, counters["@event keypressed"]) acc = min(acc, counters["handling input"]) counters["handling input"] = max(counters["handling input"] - acc, 0) counters["@event keypressed"] = max(counters["@event keypressed"] - acc, 0) counters["@save key pressed"] = counters["@save key pressed"] + acc * 1 counters["spawn 100 circles"] = counters["spawn 100 circles"] + acc * 1 return true end if counters["spawn 100 circles"] > 0 then local acc = counters["spawn 100 circles"] counters["spawn 100 circles"] = max(counters["spawn 100 circles"] - acc, 0) counters["make circles:100"] = counters["make circles:100"] + acc * 1 return true end if counters["make circles"] > 0 and counters["@once"] > 0 then local acc = huge acc = min(acc, counters["make circles"]) acc = min(acc, counters["@once"]) counters["make circles"] = max(counters["make circles"] - acc, 0) counters["@once"] = max(counters["@once"] - acc, 0) counters["circle count"] = counters["circle count"] + acc * 1 counters["@once"] = counters["@once"] + acc * 1 counters["make circle"] = counters["make circle"] + acc * 1 return true end if counters["make circles"] > 0 and counters["@once"] > 0 then local acc = huge acc = min(acc, counters["make circles"]) acc = min(acc, counters["@once"]) counters["make circles"] = max(counters["make circles"] - acc, 0) counters["@once"] = max(counters["@once"] - acc, 0) return true end if counters["handling input"] > 0 and counters["@event mousepressed"] > 0 then local acc = huge acc = min(acc, counters["@event mousepressed"]) acc = min(acc, counters["handling input"]) counters["handling input"] = max(counters["handling input"] - acc, 0) counters["@event mousepressed"] = max(counters["@event mousepressed"] - acc, 0) counters["shoot bullet"] = counters["shoot bullet"] + acc * 1 return true end if counters["shoot bullet"] > 0 then local acc = counters["shoot bullet"] counters["shoot bullet"] = max(counters["shoot bullet"] - acc, 0) counters["@shoot bullet"] = counters["@shoot bullet"] + acc * 1 return true end if counters["drawing scene"] > 0 then local acc = counters["drawing scene"] counters["drawing scene"] = max(counters["drawing scene"] - acc, 0) counters["draw zombies"] = counters["draw zombies"] + acc * 1 counters["draw player"] = counters["draw player"] + acc * 1 counters["@print fps"] = counters["@print fps"] + acc * 1 counters["draw bullets"] = counters["draw bullets"] + acc * 1 return true end if counters["draw player"] > 0 then local acc = counters["draw player"] counters["draw player"] = max(counters["draw player"] - acc, 0) counters["@draw player"] = counters["@draw player"] + acc * 1 return true end if counters["draw bullets"] > 0 then local acc = counters["draw bullets"] counters["draw bullets"] = max(counters["draw bullets"] - acc, 0) counters["@draw bullets"] = counters["@draw bullets"] + acc * 1 return true end if counters["draw zombies"] > 0 then local acc = counters["draw zombies"] counters["draw zombies"] = max(counters["draw zombies"] - acc, 0) counters["@draw zombies"] = counters["@draw zombies"] + acc * 1 return true end if counters["updating scene"] > 0 then local acc = counters["updating scene"] counters["updating scene"] = max(counters["updating scene"] - acc, 0) counters["move player"] = counters["move player"] + acc * 1 counters["check for collisions"] = counters["check for collisions"] + acc * 1 counters["sweep deleted entities"] = counters["sweep deleted entities"] + acc * 1 counters["update spawn timer"] = counters["update spawn timer"] + acc * 1 counters["move bullets"] = counters["move bullets"] + acc * 1 counters["move zombies"] = counters["move zombies"] + acc * 1 return true end if counters["move player"] > 0 then local acc = counters["move player"] counters["move player"] = max(counters["move player"] - acc, 0) counters["@is [move right] down?"] = counters["@is [move right] down?"] + acc * 1 counters["@is [move down] down?"] = counters["@is [move down] down?"] + acc * 1 counters["moving player"] = counters["moving player"] + acc * 1 counters["@is [move left] down?"] = counters["@is [move left] down?"] + acc * 1 counters["@is [move up] down?"] = counters["@is [move up] down?"] + acc * 1 return true end if counters["moving player"] > 0 and counters["@[move up] is down"] > 0 then local acc = huge acc = min(acc, counters["moving player"]) acc = min(acc, counters["@[move up] is down"]) counters["moving player"] = max(counters["moving player"] - acc, 0) counters["@[move up] is down"] = max(counters["@[move up] is down"] - acc, 0) counters["moving player"] = counters["moving player"] + acc * 1 counters["@dir up"] = counters["@dir up"] + acc * 1 return true end if counters["moving player"] > 0 and counters["@[move left] is down"] > 0 then local acc = huge acc = min(acc, counters["moving player"]) acc = min(acc, counters["@[move left] is down"]) counters["moving player"] = max(counters["moving player"] - acc, 0) counters["@[move left] is down"] = max(counters["@[move left] is down"] - acc, 0) counters["moving player"] = counters["moving player"] + acc * 1 counters["@dir left"] = counters["@dir left"] + acc * 1 return true end if counters["moving player"] > 0 and counters["@[move down] is down"] > 0 then local acc = huge acc = min(acc, counters["moving player"]) acc = min(acc, counters["@[move down] is down"]) counters["moving player"] = max(counters["moving player"] - acc, 0) counters["@[move down] is down"] = max(counters["@[move down] is down"] - acc, 0) counters["moving player"] = counters["moving player"] + acc * 1 counters["@dir down"] = counters["@dir down"] + acc * 1 return true end if counters["moving player"] > 0 and counters["@[move right] is down"] > 0 then local acc = huge acc = min(acc, counters["moving player"]) acc = min(acc, counters["@[move right] is down"]) counters["moving player"] = max(counters["moving player"] - acc, 0) counters["@[move right] is down"] = max(counters["@[move right] is down"] - acc, 0) counters["moving player"] = counters["moving player"] + acc * 1 counters["@dir right"] = counters["@dir right"] + acc * 1 return true end if counters["@dir left"] > 0 and counters["@dir right"] > 0 then local acc = huge acc = min(acc, counters["@dir right"]) acc = min(acc, counters["@dir left"]) counters["@dir left"] = max(counters["@dir left"] - acc, 0) counters["@dir right"] = max(counters["@dir right"] - acc, 0) return true end if counters["@dir down"] > 0 and counters["@dir up"] > 0 then local acc = huge acc = min(acc, counters["@dir up"]) acc = min(acc, counters["@dir down"]) counters["@dir down"] = max(counters["@dir down"] - acc, 0) counters["@dir up"] = max(counters["@dir up"] - acc, 0) return true end if counters["moving player"] > 0 then local acc = counters["moving player"] counters["moving player"] = max(counters["moving player"] - acc, 0) counters["@move player"] = counters["@move player"] + acc * 1 return true end if counters["move bullets"] > 0 then local acc = counters["move bullets"] counters["move bullets"] = max(counters["move bullets"] - acc, 0) counters["@move bullets"] = counters["@move bullets"] + acc * 1 return true end if counters["move zombies"] > 0 then local acc = counters["move zombies"] counters["move zombies"] = max(counters["move zombies"] - acc, 0) counters["@move zombies"] = counters["@move zombies"] + acc * 1 return true end if counters["check for collisions"] > 0 then local acc = counters["check for collisions"] counters["check for collisions"] = max(counters["check for collisions"] - acc, 0) counters["check for player hit by zombie"] = counters["check for player hit by zombie"] + acc * 1 counters["check for bullet hitting zombie"] = counters["check for bullet hitting zombie"] + acc * 1 return true end if counters["check for player hit by zombie"] > 0 then local acc = counters["check for player hit by zombie"] counters["check for player hit by zombie"] = max(counters["check for player hit by zombie"] - acc, 0) counters["@do player collisions"] = counters["@do player collisions"] + acc * 1 return true end if counters["check for bullet hitting zombie"] > 0 then local acc = counters["check for bullet hitting zombie"] counters["check for bullet hitting zombie"] = max(counters["check for bullet hitting zombie"] - acc, 0) counters["@do bullet collisions"] = counters["@do bullet collisions"] + acc * 1 return true end if counters["update spawn timer"] > 0 then local acc = counters["update spawn timer"] counters["update spawn timer"] = max(counters["update spawn timer"] - acc, 0) counters["@update spawn timer"] = counters["@update spawn timer"] + acc * 1 return true end if counters["@spawn timer expired"] > 0 then local acc = counters["@spawn timer expired"] counters["@spawn timer expired"] = max(counters["@spawn timer expired"] - acc, 0) counters["spawn a zombie"] = counters["spawn a zombie"] + acc * 1 counters["make the timer faster"] = counters["make the timer faster"] + acc * 1 counters["reset timer"] = counters["reset timer"] + acc * 1 return true end if counters["spawn a zombie"] > 0 then local acc = counters["spawn a zombie"] counters["spawn a zombie"] = max(counters["spawn a zombie"] - acc, 0) counters["@spawn a zombie"] = counters["@spawn a zombie"] + acc * 1 return true end if counters["make the timer faster"] > 0 then local acc = counters["make the timer faster"] counters["make the timer faster"] = max(counters["make the timer faster"] - acc, 0) counters["@make the timer faster"] = counters["@make the timer faster"] + acc * 1 return true end if counters["reset timer"] > 0 then local acc = counters["reset timer"] counters["reset timer"] = max(counters["reset timer"] - acc, 0) counters["@reset timer"] = counters["@reset timer"] + acc * 1 return true end if counters["sweep deleted entities"] > 0 then local acc = counters["sweep deleted entities"] counters["sweep deleted entities"] = max(counters["sweep deleted entities"] - acc, 0) counters["@delete out of bounds bullets"] = counters["@delete out of bounds bullets"] + acc * 1 counters["@delete killed zombies"] = counters["@delete killed zombies"] + acc * 1 return true end if counters["handling input"] > 0 then local acc = counters["handling input"] counters["handling input"] = max(counters["handling input"] - acc, 0) return true end if counters["updating scene"] > 0 then local acc = counters["updating scene"] counters["updating scene"] = max(counters["updating scene"] - acc, 0) return true end if counters["drawing scene"] > 0 then local acc = counters["drawing scene"] counters["drawing scene"] = max(counters["drawing scene"] - acc, 0) return true end if counters["run main loop"] > 0 then local acc = counters["run main loop"] counters["run main loop"] = max(counters["run main loop"] - acc, 0) counters["run current frame"] = counters["run current frame"] + acc * 1 counters["start polling inputs"] = counters["start polling inputs"] + acc * 1 counters["handle input"] = counters["handle input"] + acc * 1 counters["poll input"] = counters["poll input"] + acc * 1 return true end if counters["start polling inputs"] > 0 then local acc = counters["start polling inputs"] counters["start polling inputs"] = max(counters["start polling inputs"] - acc, 0) counters["@start polling"] = counters["@start polling"] + acc * 1 return true end if counters["poll input"] > 0 then local acc = counters["poll input"] counters["poll input"] = max(counters["poll input"] - acc, 0) counters["@poll input"] = counters["@poll input"] + acc * 1 return true end if counters["handle input"] > 0 and counters["@no events left"] > 0 then local acc = huge acc = min(acc, counters["handle input"]) acc = min(acc, counters["@no events left"]) counters["handle input"] = max(counters["handle input"] - acc, 0) counters["@no events left"] = max(counters["@no events left"] - acc, 0) return true end if counters["handle input"] > 0 then local acc = counters["handle input"] counters["handle input"] = max(counters["handle input"] - acc, 0) counters["handling input"] = counters["handling input"] + acc * 1 counters["handle input"] = counters["handle input"] + acc * 1 counters["poll input"] = counters["poll input"] + acc * 1 return true end if counters["run current frame"] > 0 and counters["@event quit"] > 0 then local acc = huge acc = min(acc, counters["run current frame"]) acc = min(acc, counters["@event quit"]) counters["run current frame"] = max(counters["run current frame"] - acc, 0) counters["@event quit"] = max(counters["@event quit"] - acc, 0) counters["@quit love"] = counters["@quit love"] + acc * 1 return true end if counters["run current frame"] > 0 then local acc = counters["run current frame"] counters["run current frame"] = max(counters["run current frame"] - acc, 0) counters["clear the screen"] = counters["clear the screen"] + acc * 1 counters["update scene state"] = counters["update scene state"] + acc * 1 counters["draw scene"] = counters["draw scene"] + acc * 1 counters["present current frame"] = counters["present current frame"] + acc * 1 counters["sleep for 1ms"] = counters["sleep for 1ms"] + acc * 1 counters["next cycle"] = counters["next cycle"] + acc * 1 counters["step timer"] = counters["step timer"] + acc * 1 return true end if counters["step timer"] > 0 then local acc = counters["step timer"] counters["step timer"] = max(counters["step timer"] - acc, 0) counters["@step timer"] = counters["@step timer"] + acc * 1 return true end if counters["clear the screen"] > 0 then local acc = counters["clear the screen"] counters["clear the screen"] = max(counters["clear the screen"] - acc, 0) counters["@clear screen"] = counters["@clear screen"] + acc * 1 return true end if counters["update scene state"] > 0 then local acc = counters["update scene state"] counters["update scene state"] = max(counters["update scene state"] - acc, 0) counters["updating scene"] = counters["updating scene"] + acc * 1 return true end if counters["draw scene"] > 0 then local acc = counters["draw scene"] counters["draw scene"] = max(counters["draw scene"] - acc, 0) counters["drawing scene"] = counters["drawing scene"] + acc * 1 return true end if counters["present current frame"] > 0 then local acc = counters["present current frame"] counters["present current frame"] = max(counters["present current frame"] - acc, 0) counters["@present"] = counters["@present"] + acc * 1 return true end if counters["sleep for 1ms"] > 0 then local acc = counters["sleep for 1ms"] counters["sleep for 1ms"] = max(counters["sleep for 1ms"] - acc, 0) counters["@ms"] = counters["@ms"] + acc * 1 return true end if counters["next cycle"] > 0 then local acc = counters["next cycle"] counters["next cycle"] = max(counters["next cycle"] - acc, 0) counters["run main loop"] = counters["run main loop"] + acc * 1 return true end return false end function machine:run() local counters = self.counters while match(self, counters) do end end return machine