local scenarios = {} local width, height = love.graphics.getWidth(), love.graphics.getHeight() local bigFont = EtBt7001Z0xa(96) local bigHeight = bigFont:getHeight() local midFont = EtBt7001Z0xa(32) local midHeight = midFont:getHeight() function BitAt(n) return math.floor(2 ^ (n - 1)) end ---@param world World function scenarios.default(world) -- TODO: Add default entities local busText = "BUS" local textWidth = bigFont:getWidth(busText) local playerScoreDisplay = world:addEntity({ position = { x = width - 100, y = 20 }, z = UiZIndex, drawAsText = { text = "0", style = TextStyle.Inverted, font = midFont, }, }) local bus = world:addEntity({ position = { x = 400, y = (height - bigHeight) / 2 }, drawAsText = { font = bigFont, text = busText, style = TextStyle.Inverted, }, score = 0, scoreDisplay = playerScoreDisplay, slots = {}, }) local slotNum = 0 local function buildSlot(text, otherEntityData) otherEntityData.position = { x = 20, y = 40 + (slotNum * midHeight * 1.2) } otherEntityData.drawAsText = { font = midFont, text = text, style = TextStyle.Inverted, } otherEntityData.upgrades = {} bus.slots[#bus.slots + 1] = world:addEntity(otherEntityData) slotNum = slotNum + 1 return otherEntityData end local wheels = buildSlot("Wheels", { scoredOn = BitAt(1), }) wheels.upgrades[#wheels.upgrades + 1] = { flatScore = 1, } buildSlot("Propulsion", { scoredOn = BitAt(2), }) buildSlot("Passengers", { scoredOn = BitAt(3), }) buildSlot("Style", { scoredOn = BitAt(4), }) buildSlot("Brakes", { scoredOn = BitAt(5), }) buildSlot("Engine", { scoredOn = BitAt(6), }) return bus end return scenarios