awful.lua
· 1.1 KiB · Lua
Eredeti
Playground
player.x = bed.x
player.y = bed.y
self:newAction("draw", homeDoor)
self:newAction("draw", bed)
self:newAction("draw", computer)
self:newAction("draw", player)
sequence(function(wait, resume)
message("Whelp, time for another week of work. [>]")
world:once("keyPressed", resume)
wait()
message("Work's been super busy. [>]")
world:once("keyPressed", resume)
wait()
message("It's a tough market to be a software shop. [>]")
world:once("keyPressed", resume)
wait()
message("Anyways, I should probably get to work.")
world:newAction("update", player)
self:newAction("draw", function()
if self:interact() then
world.active = true
if player:touches(homeDoor) then
self:goToWork()
elseif player:touches(computer) then
message("Wish I had time for a quick browse, but I can't afford the distraction.")
elseif player:touches(bed) then
message("haha, I wish I could sleep in more. But need to get that money.")
end
end
end)
end)
| 1 | player.x = bed.x |
| 2 | player.y = bed.y |
| 3 | self:newAction("draw", homeDoor) |
| 4 | self:newAction("draw", bed) |
| 5 | self:newAction("draw", computer) |
| 6 | self:newAction("draw", player) |
| 7 | sequence(function(wait, resume) |
| 8 | message("Whelp, time for another week of work. [>]") |
| 9 | world:once("keyPressed", resume) |
| 10 | wait() |
| 11 | message("Work's been super busy. [>]") |
| 12 | world:once("keyPressed", resume) |
| 13 | wait() |
| 14 | message("It's a tough market to be a software shop. [>]") |
| 15 | world:once("keyPressed", resume) |
| 16 | wait() |
| 17 | message("Anyways, I should probably get to work.") |
| 18 | world:newAction("update", player) |
| 19 | self:newAction("draw", function() |
| 20 | if self:interact() then |
| 21 | world.active = true |
| 22 | if player:touches(homeDoor) then |
| 23 | self:goToWork() |
| 24 | elseif player:touches(computer) then |
| 25 | message("Wish I had time for a quick browse, but I can't afford the distraction.") |
| 26 | elseif player:touches(bed) then |
| 27 | message("haha, I wish I could sleep in more. But need to get that money.") |
| 28 | end |
| 29 | end |
| 30 | end) |
| 31 | end) |