X Tutup
Skip to content

Commit a3f9d79

Browse files
committed
render boxes
1 parent 1e58e36 commit a3f9d79

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

feed.moon

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class Head extends Box
137137
@health = 1 if @health > 1
138138

139139
class Bat extends Box
140-
lazy sprite: -> Spriter "images/tiles.png", 10, 10
140+
lazy sprite: -> Spriter "images/tiles.png"
141141

142142
color: { 200, 188, 66 }
143143

@@ -204,7 +204,7 @@ class Bat extends Box
204204

205205

206206
class FoodItem extends Particle
207-
lazy sprite: -> Spriter "images/tiles.png", 10, 10
207+
lazy sprite: -> Spriter "images/tiles.png"
208208

209209
life: 4.0
210210
hit: false
@@ -265,6 +265,8 @@ class SodaItem extends FoodItem
265265
type: "soda"
266266

267267
class FoodPile extends Box
268+
lazy sprite: -> Spriter "images/tiles.png"
269+
268270
color: {100, 100, 100}
269271

270272
w: 20
@@ -289,7 +291,12 @@ class FoodPile extends Box
289291
update: (dt) =>
290292
true
291293

292-
draw: => super @color
294+
draw_back: =>
295+
@sprite\draw "10,180,34,40", @x - 7, @y - 7
296+
297+
draw: =>
298+
@sprite\draw "50,180,26,20", @x - 3, @y
299+
Box.outline @, @color
293300

294301
new: (state) =>
295302
@inventory = state.game.inventory
@@ -359,6 +366,10 @@ class FeedStage extends Stage
359366
FeedHud @
360367

361368
draw: =>
369+
for e in *@entities
370+
if e.draw_back
371+
e\draw_back!
372+
362373
super!
363374
@particles\draw!
364375

images/tiles.png

943 Bytes
Loading

images/tiles.xcf

2.03 KB
Binary file not shown.

0 commit comments

Comments
 (0)
X Tutup