local phys = require("phys") local inspect = require("inspect") local actors = {} function actors.buildActors(game) local asteroids = {} local asteroids_mt = { __index = asteroids } function asteroids.new(asteroid) local stageIndex = asteroid.stage or #game.asteroids.stages local stage = game.asteroids.stages[stageIndex] local instance = { angle = math.random() * phys.tau, speed = stage.speed, facing = math.random() * phys.tau, spin = (math.random() - 0.5), radius = stage.radius, sprite = stage.sprite, } for k, v in pairs(asteroid) do instance[k] = v end instance.stage = stageIndex setmetatable(instance, asteroids_mt) return instance end return { asteroids = asteroids, } end return actors