Browse Source

Put in bread;

bjorn 10 năm trước cách đây
mục cha
commit
0aca33cce7
1 tập tin đã thay đổi với 5 bổ sung2 xóa
  1. 5 2
      goal.lua

+ 5 - 2
goal.lua

@@ -4,11 +4,14 @@ Goal.size = 25
 function Goal:init()
   self.x = ctx.map.width - ctx.view.width / 2
   self.y = ctx.map.height - ctx.map.ground.height - self.size
+  self.image = data.media.graphics.bread
   ctx.event:emit('view.register', {object = self})
 end
 
 function Goal:draw()
   local g = love.graphics
-  g.setColor(0, 255, 0)
-  g.rectangle('line', self.x - self.size / 2, self.y - self.size / 2, self.size, self.size)
+  g.setColor(255, 255, 255)
+  local height = 100
+  local scale = height / self.image:getHeight()
+  g.draw(self.image, self.x + self.image:getWidth() * scale / 2, self.y - height / 2, math.sin(ls.tick / 10) / 10, scale, scale, self.image:getWidth() / 2, self.image:getHeight() / 2)
 end