(supertux-sprite
(action
(name "left")
- (x-offset 1)
- (y-offset 0)
+ (hitbox 1 0 0 0)
(images "left-0.png"
"left-1.png"
"left-2.png"
(action
(name "right")
- (x-offset 1)
- (y-offset 0)
+ (hitbox 1 0 0 0)
(mirror-action "left"))
(action
(name "squished")
- (x-offset 1)
- (y-offset -19)
+ (hitbox 1 --19 0 0)
(images "../snowball/squished-left.png"))
)
(supertux-sprite
(action
(name "flying-left")
- (x-offset 3)
- (y-offset 3)
+ (hitbox 3 3 0 0)
(images "flying.png")
)
(action
(name "flying-right")
- (x-offset 3)
- (y-offset 3)
+ (hitbox 3 3 0 0)
(mirror-action "flying-left")
)
)
(supertux-sprite
(action
(name "dropper")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(images "dropper.png"))
(action
(name "working-left")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(images "working.png"))
(action
(name "broken-left")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(images "broken.png"))
(action
(name "working-right")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(mirror-action "working-left"))
(action
(name "broken-right")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(mirror-action "broken-left"))
)
(action
(name "left")
(fps 6)
- (x-offset 0)
- (y-offset 40)
+ (hitbox 0 40 0 0)
(images "walk-1.png" "walk-2.png")
)
(action
(name "right")
(fps 6)
- (x-offset 0)
- (y-offset 40)
+ (hitbox 0 40 0 0)
(mirror-action "left")
)
(action
(name "stand")
- (x-offset 0)
- (y-offset 40)
+ (hitbox 0 40 0 0)
(images "stand.png"))
(action
(name "throw")
(fps 6)
- (x-offset 0)
- (y-offset 40)
+ (hitbox 0 40 0 0)
(images "throw.png"))
(action
(name "jump")
- (x-offset 0)
- (y-offset 40)
+ (hitbox 0 40 0 0)
(images "jump.png"))
(action
(name "dead")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(images "dead.png")
)
)
(supertux-sprite
(action
(name "normal")
- (x-offset 2)
- (y-offset 3)
+ (hitbox 2 3 0 0)
(images "left-0.png"
"left-1.png"))
(action
(name "down")
- (x-offset 2)
- (y-offset 11)
+ (hitbox 2 11 0 0)
(images "down.png"))
(action
(name "iced")
- (x-offset 2)
- (y-offset 3)
+ (hitbox 2 3 0 0)
(images "iced-left.png"))
(action
(name "iced-down")
- (x-offset 2)
- (y-offset 11)
+ (hitbox 2 11 0 0)
(images "iced-down.png"))
)
(sprite
(action
(name "normal")
- (x-offset 2)
- (y-offset 3)
+ (hitbox 2 3 0 0)
(images "left-0.png"
"left-1.png"))
(action
(name "down")
- (x-offset 2)
- (y-offset 11)
+ (hitbox 2 11 0 0)
(images "down.png"))
)
(supertux-sprite
(action
(name "left")
- (x-offset 4)
- (y-offset 3)
+ (hitbox 4 3 0 0)
(images "left-0.png"
"left-1.png"))
(action
(name "right")
- (x-offset 4)
- (y-offset 3)
+ (hitbox 4 3 0 0)
(mirror-action "left"))
(action
(name "squished-left")
- (x-offset 4)
- (y-offset -12)
+ (hitbox 4 --12 0 0)
(images "squished-left.png"))
(action
(name "squished-right")
- (x-offset 4)
- (y-offset -12)
+ (hitbox 4 --12 0 0)
(mirror-action "squished-left"))
)
(action
(name "left-up")
- (x-offset 7)
- (y-offset 8)
+ (hitbox 7 8 0 0)
(images "left-up.png"))
(action
(name "right-up")
- (x-offset 7)
- (y-offset 8)
+ (hitbox 7 8 0 0)
(mirror-action "left-up"))
(action
(name "left-down")
- (x-offset 7)
- (y-offset 8)
+ (hitbox 7 8 0 0)
(images "left-down.png"))
(action
(name "right-down")
- (x-offset 7)
- (y-offset 8)
+ (hitbox 7 8 0 0)
(mirror-action "left-down"))
(action
(name "left-middle")
- (x-offset 7)
- (y-offset 8)
+ (hitbox 7 8 0 0)
(images "left-middle.png"))
(action
(name "right-middle")
- (x-offset 7)
- (y-offset 8)
+ (hitbox 7 8 0 0)
(mirror-action "left-middle"))
(action
(name "left-iced")
- (x-offset 7)
- (y-offset 8)
+ (hitbox 7 8 0 0)
(images "iced-left-up.png"))
(action
(name "right-iced")
- (x-offset 7)
- (y-offset 8)
+ (hitbox 7 8 0 0)
(mirror-action "left-iced"))
)
(supertux-sprite
(action
(name "falling")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(images "falling-0.png"
"falling-1.png"
"falling-2.png"))
(action
(name "flying")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(images "flying-0.png"
"flying-1.png"
"flying-2.png"))
(action
(name "pop")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(fps 20)
(images "pop-0.png"
"pop-1.png"
(action
(name "ticking-left")
(fps 15.0)
- (x-offset 3)
- (y-offset 8)
+ (hitbox 3 8 0 0)
(images "exploding-left-0.png"
"exploding-left-1.png"))
(action
(name "ticking-right")
(fps 15.0)
- (x-offset 10)
- (y-offset 8)
+ (hitbox 10 8 0 0)
(mirror-action "ticking-left"))
(action
(name "explosion")
(fps 15.0)
- (x-offset 32)
- (y-offset 32)
+ (hitbox 32 32 0 0)
(images "explosion-0.png"
"explosion-1.png"))
)
(action
(name "left")
(fps 10.0)
- (x-offset 3)
- (y-offset 12)
+ (hitbox 3 12 0 0)
(images "left-0.png"
"left-1.png"
"left-2.png"
(action
(name "right")
(fps 10.0)
- (x-offset 7)
- (y-offset 12)
+ (hitbox 7 12 0 0)
(mirror-action "left"))
(action
(name "iced-left")
- (x-offset 3)
- (y-offset 12)
+ (hitbox 3 12 0 0)
(images "iced-left.png"))
(action
(name "iced-right")
- (x-offset 7)
- (y-offset 12)
+ (hitbox 7 12 0 0)
(mirror-action "iced-left"))
)
(supertux-sprite
(action
(name "left")
- (x-offset 2)
- (y-offset 3)
+ (hitbox 2 3 0 0)
(images "left-0.png"
"left-1.png"
"left-2.png"
"left-1.png"))
(action (name "right")
- (x-offset 2)
- (y-offset 3)
+ (hitbox 2 3 0 0)
(mirror-action "left"))
(action (name "falling-left")
- (x-offset 2)
- (y-offset 3)
+ (hitbox 2 3 0 0)
(images "flat-left.png"))
(action (name "falling-right")
- (x-offset 2)
- (y-offset 3)
+ (hitbox 2 3 0 0)
(mirror-action "falling-left"))
(action (name "flat-left")
- (x-offset 2)
- (y-offset 3)
+ (hitbox 2 3 0 0)
(images "flat-left.png"))
(action (name "flat-right")
- (x-offset 2)
- (y-offset 3)
+ (hitbox 2 3 0 0)
(mirror-action "falling-left")))
(action
(name "explosion-left")
(fps 15.0)
- (x-offset 0)
- (y-offset 32)
+ (hitbox 0 32 0 0)
(images "explosion-0.png"
"explosion-1.png")
)
(action
(name "explosion-right")
(fps 15.0)
- (x-offset 0)
- (y-offset 32)
+ (hitbox 0 32 0 0)
(mirror-action "explosion-left")
)
)
(action
(name "left")
(fps 15.0)
- (x-offset 3)
- (y-offset 12)
+ (hitbox 3 12 0 0)
(images "flying-0.png"
"flying-1.png"
"flying-2.png"
(action
(name "right")
(fps 10.0)
- (x-offset 7)
- (y-offset 12)
+ (hitbox 7 12 0 0)
(mirror-action "left")
)
(action
(name "squished-left")
- (x-offset 7)
- (y-offset 0)
+ (hitbox 7 0 0 0)
(images "squished.png")
)
(action
(name "squished-right")
- (x-offset 7)
- (y-offset 0)
+ (hitbox 7 0 0 0)
(mirror-action "squished-left"))
(action
(name "collision-left")
- (x-offset 3)
- (y-offset 12)
+ (hitbox 3 12 0 0)
(images "collision.png"))
(action
(name "collision-right")
- (x-offset 3)
- (y-offset 12)
+ (hitbox 3 12 0 0)
(mirror-action "squished-left")
)
)
(supertux-sprite
(action
- (y-offset -2)
+ (hitbox 0 -2 84.8 84.8)
(name "large-left")
(images "walk-left-1.png"
"walk-left-2.png"
)
)
(action
- (y-offset -2)
+ (hitbox 0 -2 84.8 84.8)
(name "large-right")
(mirror-action "large-left")
)
(action
- (x-offset 20)
- (y-offset 23)
+ (hitbox 20 23 42 62)
(name "small-left")
(images "small-left-1.png"
"small-left-2.png"
)
)
(action
- (x-offset 20)
- (y-offset 23)
+ (hitbox 20 23 42 62)
(name "small-right")
(mirror-action "small-left")
)
(action
- (x-offset 20)
- (y-offset 23)
+ (hitbox 20 23 42 42)
(name "squished-left")
(images "squished-left.png")
)
(action
- (x-offset 20)
- (y-offset 23)
+ (hitbox 20 23 42 42)
(name "squished-right")
(mirror-action "squished-left")
)
(action
(name "left")
(fps 6)
- (x-offset 0)
- (y-offset 40)
+ (hitbox 0 40 0 0)
(images "walk-0.png"
"walk-1.png"
"walk-2.png"
(action
(name "right")
(fps 6)
- (x-offset 0)
- (y-offset 40)
+ (hitbox 0 40 0 0)
(mirror-action "left")
)
(action
(name "stand")
- (x-offset 0)
- (y-offset 40)
+ (hitbox 0 40 0 0)
(images "walk-0.png")
)
(action
(name "throw")
(fps 6)
- (x-offset 0)
- (y-offset 40)
+ (hitbox 0 40 0 0)
(images "jump-0.png"
)
)
(action
(name "jump")
- (x-offset 0)
- (y-offset 40)
+ (hitbox 0 40 0 0)
(images "jump-0.png"
"jump-1.png"
)
(action
(name "dead")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(images "throw-0.png")
)
)
(supertux-sprite
(action
(name "left")
- (x-offset 6)
- (y-offset 10)
+ (hitbox 6 10 0 0)
(images "left-0.png"
"left-1.png"
"left-2.png"))
(action
(name "right")
- (x-offset 6)
- (y-offset 10)
+ (hitbox 6 10 0 0)
(mirror-action "left"))
(action
(name "iced-left")
- (x-offset 6)
- (y-offset 10)
+ (hitbox 6 10 0 0)
(images "iced-left.png"))
(action
(name "iced-right")
- (x-offset 6)
- (y-offset 10)
+ (hitbox 6 10 0 0)
(mirror-action "iced-left")
)
(action
(name "sleeping-left")
- (x-offset 6)
- (y-offset 10)
+ (hitbox 6 10 0 0)
(images "sleeping-left.png"))
(action
(name "sleeping-right")
- (x-offset 6)
- (y-offset 10)
+ (hitbox 6 10 0 0)
(mirror-action "sleeping-left"))
(action
(name "waking-left")
- (x-offset 6)
- (y-offset 10)
+ (hitbox 6 10 0 0)
(fps 6.0)
(images "waking-left-0.png"
"waking-left-1.png"
(action
(name "waking-right")
(fps 6.0)
- (x-offset 6)
- (y-offset 10)
+ (hitbox 6 10 0 0)
(mirror-action "waking-left"))
)
(supertux-sprite
(action
(name "left")
- (x-offset 2)
- (y-offset 4)
+ (hitbox 2 4 0 0)
(images "left-0.png"
"left-1.png"
"left-2.png"))
(action
(name "right")
- (x-offset 2)
- (y-offset 4)
+ (hitbox 2 4 0 0)
(mirror-action "left"))
(action
(name "squished-left")
- (x-offset 0)
- (y-offset 3)
+ (hitbox 0 3 0 0)
(images "squished.png"))
(action
(name "squished-right")
- (x-offset 0)
- (y-offset 3)
+ (hitbox 0 3 0 0)
(mirror-action "squished-left")
)
)
(supertux-sprite
(action
(name "standing-left")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(images "standing-0.png"))
(action
(name "standing-right")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(mirror-action "standing-left"))
(action
(name "charging-left")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(fps 10.0)
(images "charging-0.png"
"charging-1.png"))
(action
(name "charging-right")
(fps 10.0)
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(mirror-action "charging-left"))
(action
(name "jumping-left")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(images "jumping-0.png"))
(action
(name "jumping-right")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(mirror-action "jumping-left"))
(action
(name "squished-left")
- (x-offset 0)
- (y-offset -14)
+ (hitbox 0 --14 0 0)
(images "squished-0.png"))
(action
(name "squished-right")
- (x-offset 0)
- (y-offset -14)
+ (hitbox 0 --14 0 0)
(mirror-action "squished-left")))
(supertux-sprite
(action
(name "left")
- (x-offset 2)
- (y-offset 3)
+ (hitbox 2 3 0 0)
(images "snowsnail1.png"
"snowsnail2.png"
"snowsnail3.png"
))
(action (name "right")
- (x-offset 2)
- (y-offset 3)
+ (hitbox 2 3 0 0)
(mirror-action "left"))
(action (name "falling-left")
- (x-offset 2)
- (y-offset 3)
+ (hitbox 2 3 0 0)
(images "snowsnail_flip1.png"
"snowsnail_flip2.png"
"snowsnail_flip3.png"
))
(action (name "falling-right")
- (x-offset 2)
- (y-offset 3)
+ (hitbox 2 3 0 0)
(mirror-action "falling-left"))
(action (name "flat-left")
- (x-offset 2)
- (y-offset 3)
+ (hitbox 2 3 0 0)
(images "snowsnail_flip1.png"
"snowsnail_flip2.png"
"snowsnail_flip3.png"
))
(action (name "flat-right")
- (x-offset 2)
- (y-offset 3)
+ (hitbox 2 3 0 0)
(mirror-action "falling-left")))
(supertux-sprite
(action
(name "left")
- (x-offset 2)
- (y-offset 4)
+ (hitbox 2 4 0 0)
(images "left-0.png"
"left-1.png"
"left-2.png")
)
(action
(name "right")
- (x-offset 2)
- (y-offset 4)
+ (hitbox 2 4 0 0)
(mirror-action "left")
)
(action
(name "squished-left")
- (x-offset 1)
- (y-offset -19)
+ (hitbox 1 --19 0 0)
(images "squished-left.png")
)
(action
(name "squished-right")
- (x-offset 1)
- (y-offset -19)
+ (hitbox 1 --19 0 0)
(mirror-action "squished-left")
)
)
(supertux-sprite
(action
(name "left")
- (x-offset 4)
- (y-offset 3)
+ (hitbox 4 3 0 0)
(images "spidermite.png"
"spidermite0.png"
"spidermite1.png"
"spidermite0.png"))
(action
(name "right")
- (x-offset 4)
- (y-offset 3)
+ (hitbox 4 3 0 0)
(mirror-action "left"))
(action
(name "squished-left")
- (x-offset 4)
- (y-offset -12)
+ (hitbox 4 --12 0 0)
(images "spidermite-squish.png"))
(action
(name "squished-right")
- (x-offset 4)
- (y-offset -12)
+ (hitbox 4 --12 0 0)
(mirror-action "squished-left")))
(supertux-sprite
(action
(name "left")
- (x-offset 6)
- (y-offset 10)
+ (hitbox 6 10 0 0)
(images "left-0.png"
"left-1.png"
"left-2.png"))
(action
(name "right")
- (x-offset 6)
- (y-offset 10)
+ (hitbox 6 10 0 0)
(mirror-action "left"))
(action
(name "iced-left")
- (x-offset 6)
- (y-offset 10)
+ (hitbox 6 10 0 0)
(images "iced-left.png"))
(action
(name "iced-right")
- (x-offset 6)
- (y-offset 10)
+ (hitbox 6 10 0 0)
(mirror-action "iced-left")
)
(action
(name "sleeping-left")
- (x-offset 6)
- (y-offset 10)
+ (hitbox 6 10 0 0)
(images "sleeping-left.png"))
(action
(name "sleeping-right")
- (x-offset 6)
- (y-offset 10)
+ (hitbox 6 10 0 0)
(mirror-action "sleeping-left"))
(action
(name "waking-left")
- (x-offset 6)
- (y-offset 10)
+ (hitbox 6 10 0 0)
(fps 6.0)
(images "waking-left-0.png"
"waking-left-1.png"
(action
(name "waking-right")
(fps 6.0)
- (x-offset 6)
- (y-offset 10)
+ (hitbox 6 10 0 0)
(mirror-action "waking-left"))
)
(supertux-sprite
(action
(name "left")
- (x-offset 6)
- (y-offset 10)
+ (hitbox 6 10 0 0)
(images "left-0.png"
"left-1.png"
"left-2.png"))
(action
(name "right")
- (x-offset 6)
- (y-offset 10)
+ (hitbox 6 10 0 0)
(mirror-action "left"))
(action
(name "iced-left")
- (x-offset 6)
- (y-offset 10)
+ (hitbox 6 10 0 0)
(images "iced-left.png"))
(action
(name "iced-right")
- (x-offset 6)
- (y-offset 10)
+ (hitbox 6 10 0 0)
(mirror-action "iced-left")
)
)
(supertux-sprite
(action
(name "normal")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(images "falling.png"))
(action
(name "squished")
- (x-offset 0)
- (y-offset 16)
+ (hitbox 0 16 0 0)
(images "broken.png")))
(action
(name "walk-right")
(fps 15.0)
- (x-offset 5)
- (y-offset 32)
+ (hitbox 5 32 0 0)
(images "head-fire-stand-0.png"))
(action
(name "walk-left")
(fps 15.0)
- (x-offset 27)
- (y-offset 32)
+ (hitbox 27 32 0 0)
(mirror-action "walk-right"))
(action
(name "stand-right")
(fps 15.0)
- (x-offset 5)
- (y-offset 32)
+ (hitbox 5 32 0 0)
(images "head-fire-stand-0.png"))
(action
(name "stand-left")
(fps 15.0)
- (x-offset 27)
- (y-offset 32)
+ (hitbox 27 32 0 0)
(mirror-action "stand-right"))
(action
(name "jump-right")
(fps 15.0)
- (x-offset 5)
- (y-offset 30)
+ (hitbox 5 30 0 0)
(images "head-fire-stand-0.png"))
(action
(name "jump-left")
(fps 15.0)
- (x-offset 27)
- (y-offset 30)
+ (hitbox 27 30 0 0)
(mirror-action "jump-right"))
(action
(name "duck-right")
(fps 15.0)
- (x-offset 5)
- (y-offset 62)
+ (hitbox 5 62 0 0)
(images "head-fire-duck-0.png"))
(action
(name "duck-left")
(fps 15.0)
- (x-offset 27)
- (y-offset 62)
+ (hitbox 27 62 0 0)
(mirror-action "duck-right"))
(action
(name "skid-right")
- (x-offset 6)
- (y-offset 31)
+ (hitbox 6 31 0 0)
(images "head-fire-skid-0.png"))
(action
(name "skid-left")
- (x-offset 27)
- (y-offset 31)
+ (hitbox 27 31 0 0)
(mirror-action "skid-right"))
(action
(name "kick-right")
- (x-offset 5)
- (y-offset 32)
+ (hitbox 5 32 0 0)
(images "head-fire-stand-0.png"))
(action
(name "kick-left")
- (x-offset 27)
- (y-offset 32)
+ (hitbox 27 32 0 0)
(mirror-action "kick-right"))
(action
(name "buttjump-right")
- (x-offset 5)
- (y-offset 32)
+ (hitbox 5 32 0 0)
(images "head-fire-stand-0.png"))
(action
(name "buttjump-left")
- (x-offset 27)
- (y-offset 32)
+ (hitbox 27 32 0 0)
(mirror-action "buttjump-right"))
(action
(name "idle-right")
(fps 1.0)
- (x-offset 6)
- (y-offset 31)
+ (hitbox 6 31 0 0)
(images "head-idle-blink-0.png"
"head-idle-blink-1.png"))
(action
(name "idle-left")
(fps 1.0)
- (x-offset 27)
- (y-offset 31)
+ (hitbox 27 31 0 0)
(mirror-action "idle-right")))
(action
(name "walk-right")
(fps 15.0)
- (x-offset 5)
- (y-offset 32)
+ (hitbox 5 32 0 0)
(images "arms-walk-0.png"
"arms-walk-1.png"
"arms-walk-2.png"
(action
(name "walk-left")
(fps 15.0)
- (x-offset 27)
- (y-offset 32)
+ (hitbox 27 32 0 0)
(mirror-action "walk-right"))
(action
(name "stand-right")
(fps 15.0)
- (x-offset 5)
- (y-offset 32)
+ (hitbox 5 32 0 0)
(images "arms-stand-0.png"))
(action
(name "stand-left")
(fps 15.0)
- (x-offset 27)
- (y-offset 32)
+ (hitbox 27 32 0 0)
(mirror-action "stand-right"))
(action
(name "jump-right")
(fps 15.0)
- (x-offset 5)
- (y-offset 30)
+ (hitbox 5 30 0 0)
(images "arms-jump-0.png"))
(action
(name "jump-left")
(fps 15.0)
- (x-offset 27)
- (y-offset 30)
+ (hitbox 27 30 0 0)
(mirror-action "jump-right"))
(action
(name "duck-right")
- (x-offset 5)
- (y-offset 62)
+ (hitbox 5 62 0 0)
(images "arms-duck-0.png"))
(action
(name "duck-left")
- (x-offset 27)
- (y-offset 62)
+ (hitbox 27 62 0 0)
(mirror-action "duck-right"))
(action
(name "skid-right")
- (x-offset 6)
- (y-offset 31)
+ (hitbox 6 31 0 0)
(images "arms-skid-0.png"))
(action
(name "skid-left")
(fps 15.0)
- (x-offset 27)
- (y-offset 31)
+ (hitbox 27 31 0 0)
(mirror-action "skid-right"))
(action
(name "kick-right")
- (x-offset 5)
- (y-offset 32)
+ (hitbox 5 32 0 0)
(images "arms-stand-0.png"))
(action
(name "kick-left")
- (x-offset 27)
- (y-offset 32)
+ (hitbox 27 32 0 0)
(mirror-action "kick-right"))
(action
(name "buttjump-right")
- (x-offset 5)
- (y-offset 32)
+ (hitbox 5 32 0 0)
(images "arms-stand-0.png"))
(action
(name "buttjump-left")
- (x-offset 27)
- (y-offset 32)
+ (hitbox 27 32 0 0)
(mirror-action "buttjump-right"))
; Grabbing is arms specific!
(action
(name "grab-right")
- (x-offset 5)
- (y-offset 32)
+ (hitbox 5 32 0 0)
(z-order 2)
(images "arms-grab-0.png"))
(action
(name "grab-left")
- (x-offset 27)
- (y-offset 32)
+ (hitbox 27 32 0 0)
(z-order 2)
(mirror-action "grab-right"))
(action
(name "duck+grab-right")
- (x-offset 5)
- (y-offset 62)
+ (hitbox 5 62 0 0)
(z-order 2)
(images "arms-duck+grab-0.png"))
(action
(name "duck+grab-left")
- (x-offset 27)
- (y-offset 62)
+ (hitbox 27 62 0 0)
(z-order 2)
(mirror-action "duck+grab-right")))
(action
(name "walk-right")
(fps 15.0)
- (x-offset 5)
- (y-offset 32)
+ (hitbox 5 32 0 0)
(images "body-stand-0.png"))
(action
(name "walk-left")
(fps 15.0)
- (x-offset 27)
- (y-offset 32)
+ (hitbox 27 32 0 0)
(mirror-action "walk-right"))
(action
(name "stand-right")
(fps 15.0)
- (x-offset 5)
- (y-offset 32)
+ (hitbox 5 32 0 0)
(images "body-stand-0.png"))
(action
(name "stand-left")
(fps 15.0)
- (x-offset 27)
- (y-offset 32)
+ (hitbox 27 32 0 0)
(mirror-action "stand-right"))
(action
(name "jump-right")
(fps 15.0)
- (x-offset 5)
- (y-offset 30)
+ (hitbox 5 30 0 0)
(images "body-stand-0.png"))
(action
(name "jump-left")
(fps 15.0)
- (x-offset 27)
- (y-offset 30)
+ (hitbox 27 30 0 0)
(mirror-action "jump-right"))
(action
(name "duck-right")
(fps 15.0)
- (x-offset 5)
- (y-offset 62)
+ (hitbox 5 62 0 0)
(images "body-duck-0.png"))
(action
(name "duck-left")
(fps 15.0)
- (x-offset 27)
- (y-offset 62)
+ (hitbox 27 62 0 0)
(mirror-action "duck-right"))
(action
(name "skid-right")
- (x-offset 6)
- (y-offset 31)
+ (hitbox 6 31 0 0)
(images "body-skid-0.png"))
(action
(name "skid-left")
(fps 15.0)
- (x-offset 27)
- (y-offset 31)
+ (hitbox 27 31 0 0)
(mirror-action "skid-right"))
(action
(name "kick-right")
- (x-offset 5)
- (y-offset 32)
+ (hitbox 5 32 0 0)
(images "body-stand-0.png"))
(action
(name "kick-left")
(fps 15.0)
- (x-offset 27)
- (y-offset 32)
+ (hitbox 27 32 0 0)
(mirror-action "kick-right"))
(action
(name "buttjump-right")
- (x-offset 5)
- (y-offset 32)
+ (hitbox 5 32 0 0)
(images "body-stand-0.png"))
(action
(name "buttjump-left")
(fps 15.0)
- (x-offset 27)
- (y-offset 32)
+ (hitbox 27 32 0 0)
(mirror-action "buttjump-right")))
(action
(name "walk-right")
(fps 15.0)
- (x-offset 5)
- (y-offset 32)
+ (hitbox 5 32 0 0)
(images "feet-walk-0.png"
"feet-walk-1.png"
"feet-walk-2.png"
(action
(name "walk-left")
(fps 15.0)
- (x-offset 27)
- (y-offset 32)
+ (hitbox 27 32 0 0)
(mirror-action "walk-right"))
(action
(name "stand-right")
(fps 15.0)
- (x-offset 5)
- (y-offset 32)
+ (hitbox 5 32 0 0)
(images "feet-stand-0.png"))
(action
(name "stand-left")
(fps 15.0)
- (x-offset 27)
- (y-offset 32)
+ (hitbox 27 32 0 0)
(mirror-action "stand-right"))
(action
(name "jump-right")
(fps 15.0)
- (x-offset 5)
- (y-offset 30)
+ (hitbox 5 30 0 0)
(images "feet-jump-0.png"))
(action
(name "jump-left")
(fps 15.0)
- (x-offset 27)
- (y-offset 30)
+ (hitbox 27 30 0 0)
(mirror-action "jump-right"))
(action
(name "duck-right")
(fps 15.0)
- (x-offset 5)
- (y-offset 62)
+ (hitbox 5 62 0 0)
(images "feet-duck-0.png"))
(action
(name "duck-left")
(fps 15.0)
- (x-offset 27)
- (y-offset 62)
+ (hitbox 27 62 0 0)
(mirror-action "duck-right"))
(action
(name "skid-right")
- (x-offset 6)
- (y-offset 31)
+ (hitbox 6 31 0 0)
(images "feet-skid-0.png"))
(action
(name "skid-left")
- (x-offset 27)
- (y-offset 31)
+ (hitbox 27 31 0 0)
(mirror-action "skid-right"))
(action
(name "kick-right")
- (x-offset 5)
- (y-offset 32)
+ (hitbox 5 32 0 0)
(images "feet-kick-0.png"))
(action
(name "kick-left")
- (x-offset 27)
- (y-offset 32)
+ (hitbox 27 32 0 0)
(mirror-action "kick-right"))
(action
(name "buttjump-right")
- (x-offset 5)
- (y-offset 32)
+ (hitbox 5 32 0 0)
(images "feet-buttjump-0.png"))
(action
(name "buttjump-left")
- (x-offset 27)
- (y-offset 32)
+ (hitbox 27 32 0 0)
(mirror-action "buttjump-right")))
(action
(name "walk-right")
(fps 15.0)
- (x-offset 5)
- (y-offset 32)
+ (hitbox 5 32 0 0)
(images "head-stand-0.png"))
(action
(name "walk-left")
(fps 15.0)
- (x-offset 27)
- (y-offset 32)
+ (hitbox 27 32 0 0)
(mirror-action "walk-right"))
(action
(name "stand-right")
(fps 15.0)
- (x-offset 5)
- (y-offset 32)
+ (hitbox 5 32 0 0)
(images "head-stand-0.png"))
(action
(name "stand-left")
(fps 15.0)
- (x-offset 27)
- (y-offset 32)
+ (hitbox 27 32 0 0)
(mirror-action "stand-right"))
(action
(name "jump-right")
(fps 15.0)
- (x-offset 5)
- (y-offset 30)
+ (hitbox 5 30 0 0)
(images "head-stand-0.png"))
(action
(name "jump-left")
(fps 15.0)
- (x-offset 27)
- (y-offset 30)
+ (hitbox 27 30 0 0)
(mirror-action "jump-right"))
(action
(name "duck-right")
(fps 15.0)
- (x-offset 5)
- (y-offset 62)
+ (hitbox 5 62 0 0)
(images "head-duck-0.png"))
(action
(name "duck-left")
(fps 15.0)
- (x-offset 27)
- (y-offset 62)
+ (hitbox 27 62 0 0)
(mirror-action "duck-right"))
(action
(name "skid-right")
- (x-offset 6)
- (y-offset 31)
+ (hitbox 6 31 0 0)
(images "head-skid-0.png"))
(action
(name "skid-left")
(fps 15.0)
- (x-offset 27)
- (y-offset 31)
+ (hitbox 27 31 0 0)
(mirror-action "skid-right"))
(action
(name "kick-right")
- (x-offset 5)
- (y-offset 32)
+ (hitbox 5 32 0 0)
(images "head-stand-0.png"))
(action
(name "kick-left")
(fps 15.0)
- (x-offset 27)
- (y-offset 32)
+ (hitbox 27 32 0 0)
(mirror-action "kick-right"))
(action
(name "buttjump-right")
- (x-offset 5)
- (y-offset 32)
+ (hitbox 5 32 0 0)
(images "head-stand-0.png"))
(action
(name "buttjump-left")
- (x-offset 27)
- (y-offset 32)
+ (hitbox 27 32 0 0)
(mirror-action "buttjump-right"))
(action
(name "idle-right")
(fps 1.0)
- (x-offset 6)
- (y-offset 31)
+ (hitbox 6 31 0 0)
(images "head-idle-blink-0.png"
"head-idle-blink-1.png"))
(action
(name "idle-left")
(fps 1.0)
- (x-offset 27)
- (y-offset 31)
+ (hitbox 27 31 0 0)
(mirror-action "idle-right")))
(supertux-sprite
(action
- (x-offset 8)
- (y-offset 8)
+ (hitbox 8 8 0 0)
(images "extra-star-0.png"
"extra-star-1.png"
"extra-star-2.png")))
(action
(name "walk-right")
(fps 15.0)
- (x-offset 5)
- (y-offset 14)
+ (hitbox 5 14 0 0)
(images "arms-walk-0.png"
"arms-walk-1.png"
"arms-walk-2.png"
(action
(name "walk-left")
(fps 15.0)
- (x-offset 5)
- (y-offset 14)
+ (hitbox 5 14 0 0)
(mirror-action "walk-right"))
(action
(name "stand-right")
(fps 15.0)
- (x-offset 5)
- (y-offset 14)
+ (hitbox 5 14 0 0)
(images "arms-walk-5.png"))
(action
(name "stand-left")
(fps 15.0)
- (x-offset 5)
- (y-offset 14)
+ (hitbox 5 14 0 0)
(mirror-action "stand-right"))
(action
(name "jump-right")
(fps 15.0)
- (x-offset 5)
- (y-offset 14)
+ (hitbox 5 14 0 0)
(images "arms-jump-0.png"))
(action
(name "jump-left")
(fps 15.0)
- (x-offset 5)
- (y-offset 14)
+ (hitbox 5 14 0 0)
(mirror-action "jump-right"))
(action
(name "skid-right")
- (x-offset 6)
- (y-offset 15)
+ (hitbox 6 15 0 0)
(images "arms-skid-0.png"))
(action
(name "skid-left")
(fps 15.0)
- (x-offset 6)
- (y-offset 15)
+ (hitbox 6 15 0 0)
(mirror-action "skid-right"))
(action
(name "kick-right")
- (x-offset 5)
- (y-offset 14)
+ (hitbox 5 14 0 0)
(images "arms-kick-0.png"))
(action
(name "kick-left")
- (x-offset 5)
- (y-offset 14)
+ (hitbox 5 14 0 0)
(mirror-action "kick-right"))
; Grabbing is arms specific!
(action
(name "grab-right")
- (x-offset 5)
- (y-offset 14)
+ (hitbox 5 14 0 0)
(z-order 2)
(images "arms-grab-0.png"))
(action
(name "grab-left")
- (x-offset 5)
- (y-offset 14)
+ (hitbox 5 14 0 0)
(z-order 2)
(mirror-action "grab-right")))
(action
(name "walk-right")
(fps 15.0)
- (x-offset 5)
- (y-offset 14)
+ (hitbox 5 14 0 0)
(images "body-walk-0.png"
"body-walk-1.png"
"body-walk-2.png"
(action
(name "walk-left")
(fps 15.0)
- (x-offset 5)
- (y-offset 14)
+ (hitbox 5 14 0 0)
(mirror-action "walk-right"))
(action
(name "stand-right")
(fps 15.0)
- (x-offset 5)
- (y-offset 14)
+ (hitbox 5 14 0 0)
(images "body-walk-5.png"))
(action
(name "stand-left")
(fps 15.0)
- (x-offset 5)
- (y-offset 14)
+ (hitbox 5 14 0 0)
(mirror-action "stand-right"))
(action
(name "jump-right")
(fps 15.0)
- (x-offset 5)
- (y-offset 14)
+ (hitbox 5 14 0 0)
(images "body-jump-0.png"))
(action
(name "jump-left")
(fps 15.0)
- (x-offset 5)
- (y-offset 14)
+ (hitbox 5 14 0 0)
(mirror-action "jump-right"))
(action
(name "skid-right")
- (x-offset 6)
- (y-offset 15)
+ (hitbox 6 15 0 0)
(images "body-skid-0.png"))
(action
(name "skid-left")
- (x-offset 6)
- (y-offset 15)
+ (hitbox 6 15 0 0)
(mirror-action "skid-right"))
(action
(name "kick-right")
- (x-offset 5)
- (y-offset 14)
+ (hitbox 5 14 0 0)
(images "body-kick-0.png"))
(action
(name "kick-left")
- (x-offset 5)
- (y-offset 14)
+ (hitbox 5 14 0 0)
(mirror-action "kick-right")))
(supertux-sprite
(action
(fps 10.0)
- (x-offset 13)
- (y-offset 6)
+ (hitbox 13 6 0 0)
(images "gameover-0.png"
"gameover-1.png")))
(supertux-sprite
(action
- (x-offset 5)
- (y-offset 15)
+ (hitbox 5 15 0 0)
(images "extra-star-0.png"
"extra-star-1.png"
"extra-star-2.png")))
(action
(name "run-right")
(fps 4.0)
- (x-offset 17)
- (y-offset 12)
+ (hitbox 17 12 0 0)
(images
"y1.png"
"y2.png"
(name "run-left")
(mirror-action "run-right")
(fps 4.0)
- (x-offset 17)
- (y-offset 12)
+ (hitbox 17 12 0 0)
)
(action
(name "jump-right")
(images
"yeti_jump.png"
)
- (x-offset 17)
- (y-offset 12)
+ (hitbox 17 12 0 0)
)
(action
(name "jump-left")
(mirror-action "jump-right")
- (x-offset 17)
- (y-offset 12)
+ (hitbox 17 12 0 0)
)
(action
(name "stand-right")
(images
"y.png"
)
- (x-offset 17)
- (y-offset 12)
+ (hitbox 17 12 0 0)
)
(action
(name "stand-left")
(mirror-action "stand-right")
- (x-offset 17)
- (y-offset 12)
+ (hitbox 17 12 0 0)
)
(action
(name "stomp-right")
(images
"y-jump.png"
)
- (x-offset 17)
- (y-offset 12)
+ (hitbox 17 12 0 0)
)
(action
(name "stomp-left")
(mirror-action "stomp-right")
- (x-offset 17)
- (y-offset 12)
+ (hitbox 17 12 0 0)
)
(action
(name "dead")
"busted2.png"
)
- (x-offset 300)
- (y-offset 400)
+ (hitbox 300 400 0 0)
)
)
(supertux-sprite
(action
(name "left")
- (x-offset 2)
- (y-offset 4)
+ (hitbox 2 4 0 0)
(images "left-0.png"
"left-1.png"
"left-2.png"
"left-3.png"))
(action
(name "right")
- (x-offset 2)
- (y-offset 4)
+ (hitbox 2 4 0 0)
(mirror-action "left"))
(action
(name "squished-left")
- (x-offset 2)
- (y-offset -19)
+ (hitbox 2 -19 0 0)
(images "squished.png"))
(action
(name "squished-right")
- (x-offset 2)
- (y-offset -19)
+ (hitbox 2 -19 0 0)
(mirror-action "squished-left"))
(action
(name "diving-left")
- (x-offset 2)
- (y-offset 4)
+ (hitbox 2 4 0 0)
(images "diving.png"))
(action
(name "diving-right")
- (x-offset 2)
- (y-offset 4)
+ (hitbox 2 4 0 0)
(mirror-action "diving-left")
)
)
(supertux-sprite
(action
- (x-offset 12)
- (x-offset 12)
+ (hitbox 12 12 0 0)
(fps 20)
(images "fire_bullet-0.png"
"fire_bullet-1.png"
(supertux-sprite
(action
- (x-offset 12)
- (x-offset 12)
+ (hitbox 12 12 0 0)
(fps 20)
(images "ice_bullet.png")
)
(supertux-sprite
(action
(name "closed")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(fps 4)
(images "castledoor_0.png"
))
(supertux-sprite
(action
(name "normal")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(images "keyholes.png"))
)
(supertux-sprite
(action
(name "normal")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(fps 4)
(images
(supertux-sprite
(action
(name "normal")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(images "door-0.png"))
(action
(name "open")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(images "door-0.png"
"door-1.png"
"door-2.png"
(supertux-sprite
(action
(name "normal")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(images "firefly1.png")
)
(action
(supertux-sprite
(action
(name "normal")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(images "hatch-0.png"))
(action
(name "open")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(images "hatch-0.png"
"hatch-1.png"
"hatch-2.png"
(supertux-sprite
(action
(name "normal")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(fps 5)
(images
"icecube.png"
(supertux-sprite
(action
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(images "stomp.png")
)
)
(supertux-sprite
(action
(name "quiet")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(images "radio1.png"))
(action
(name "loud")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(images "radio1.png"
"radio2.png"
"radio3.png")
(supertux-sprite
(action
(name "normal")
- (x-offset 0)
- (y-offset 0)
+ (hitbox 0 0 0 0)
(images "trampoline1-0.png"
"trampoline1-1.png"
"trampoline1-2.png"
(supertux-sprite
(action
(name "default")
- (x-offset 16)
- (y-offset 16)
+ (hitbox 16 16 0 0)
(images "leveldot_red.png")
)
(action
(name "solved")
- (x-offset 16)
- (y-offset 16)
+ (hitbox 16 16 0 0)
(images "leveldot_green.png")
)
)
(supertux-sprite
(action
(name "default")
- (x-offset 16)
- (y-offset 16)
+ (hitbox 16 16 0 0)
(images "n_stone.png")
)
(action
(name "solved")
- (x-offset 16)
- (y-offset 16)
+ (hitbox 16 16 0 0)
(images "n_stone.png")
)
)
(supertux-sprite
(action
(name "default")
- (x-offset 16)
- (y-offset 16)
+ (hitbox 16 16 0 0)
(images "shroom.png"
"shroom1.png"
"shroom2.png"
)
(action
(name "solved")
- (x-offset 16)
- (y-offset 16)
+ (hitbox 16 16 0 0)
(images "level_star.png"
"level_star1.png"
"level_star1.png"
(supertux-sprite
(action
(name "default")
- (x-offset 16)
- (y-offset 16)
+ (hitbox 16 16 0 0)
(fps 3)
(images "teleporterdot_1.png"
"teleporterdot_2.png"
(supertux-sprite
(action
(name "default")
- (x-offset 16)
- (y-offset 16)
+ (hitbox 16 16 0 0)
(fps 6)
(images "torch.png"
)
(action
(name "solved")
- (x-offset 16)
- (y-offset 16)
+ (hitbox 16 16 0 0)
(fps 1)
(images "smoke1.png"
"smoke2.png"
(supertux-sprite
(action
(name "default")
- (x-offset 16)
- (y-offset 16)
+ (hitbox 16 16 0 0)
(fps 6)
(images "torch.png"
"torch.png"
)
(action
(name "solved")
- (x-offset 16)
- (y-offset 16)
+ (hitbox 16 16 0 0)
(fps 1)
(images "smoke1.png"
"smoke2.png"
(supertux-sprite
(action
(name "small-stop")
- (x-offset 5)
- (y-offset 20)
+ (hitbox 5 20 0 0)
(images "smalltux.png")
)
(action
(name "small-walking")
- (x-offset 5)
- (y-offset 20)
+ (hitbox 5 20 0 0)
(images "smalltux.png"
"smalltux1.png"
"smalltux2.png"
)
(action
(name "large-walking")
- (y-offset 10)
+ (hitbox 0 10 0 0)
(images "tux.png")
)
(action
(name "large-stop")
- (y-offset 10)
+ (hitbox 0 10 0 0)
(images "tux.png")
)
(action
(name "fire-walking")
- (y-offset 10)
+ (hitbox 0 10 0 0)
(images "firetux.png")
)
(action
(name "fire-stop")
- (y-offset 10)
+ (hitbox 0 10 0 0)
(images "firetux.png")
)
)
(supertux-sprite
(action
(name "default")
- (x-offset 0)
- (y-offset 65)
+ (hitbox 0 65 0 0)
(fps 5)
(images "../../creatures/yeti/worldmap_1.png"
"../../creatures/yeti/worldmap_1.png"
)
(action
(name "solved")
- (x-offset 0)
- (y-offset 65)
+ (hitbox 0 65 0 0)
(fps 3)
(images "../../creatures/yeti/iceyeti_dust_wm_0.png"
"../../creatures/yeti/iceyeti_dust_wm_1.png"
static const float WALKSPEED_SMALL = 120;
static const float INVINCIBLE_TIME = 1;
+static const float POISONIVY_WIDTH = 32;
+static const float POISONIVY_HEIGHT = 32;
+static const float POISONIVY_Y_OFFSET = 24;
+
+
MrTree::MrTree(const lisp::Lisp& reader)
: mystate(STATE_BIG)
{
reader.get("x", start_position.x);
reader.get("y", start_position.y);
- bbox.set_size(84.8, 84.8);
sprite = sprite_manager->create("images/creatures/mr_tree/mr_tree.sprite");
+ sprite->set_action(dir == LEFT ? "large-left" : "large-right");
+ bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height());
}
void
if(mystate == STATE_BIG) {
mystate = STATE_INVINCIBLE;
invincible_timer.start(INVINCIBLE_TIME);
+
+ float old_x_offset = sprite->get_current_hitbox_x_offset();
+ float old_y_offset = sprite->get_current_hitbox_y_offset();
activate();
// shrink bounding box and adjust sprite position to where the stump once was
- bbox.set_size(42, 62);
+ bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height());
Vector pos = get_pos();
- pos.x += 20;
- pos.y += 23;
+ pos.x += sprite->get_current_hitbox_x_offset() - old_x_offset;
+ pos.y += sprite->get_current_hitbox_y_offset() - old_y_offset;
set_pos(pos);
sound_manager->play("sounds/mr_tree.ogg", get_pos());
player.bounce(*this);
- Rect leaf1_bbox = Rect(pos.x-32-1, pos.y-23+1, pos.x-32-1+32, pos.y-23+1+32);
+ Vector leaf1_pos = Vector(pos.x - POISONIVY_WIDTH - 1, pos.y - POISONIVY_Y_OFFSET);
+ Rect leaf1_bbox = Rect(leaf1_pos.x, leaf1_pos.y, leaf1_pos.x + POISONIVY_WIDTH, leaf1_pos.y + POISONIVY_HEIGHT);
if (Sector::current()->is_free_space(leaf1_bbox)) {
PoisonIvy* leaf1 = new PoisonIvy(leaf1_bbox.p1.x, leaf1_bbox.p1.y, LEFT);
Sector::current()->add_object(leaf1);
}
- Rect leaf2_bbox = Rect(pos.x+42+1, pos.y-23+1, pos.x+32+1+32, pos.y-23+1+32);
+ Vector leaf2_pos = Vector(pos.x + sprite->get_current_hitbox_width() + 1, pos.y - POISONIVY_Y_OFFSET);
+ Rect leaf2_bbox = Rect(leaf2_pos.x, leaf2_pos.y, leaf2_pos.x + POISONIVY_WIDTH, leaf2_pos.y + POISONIVY_HEIGHT);
if (Sector::current()->is_free_space(leaf2_bbox)) {
PoisonIvy* leaf2 = new PoisonIvy(leaf2_bbox.p1.x, leaf2_bbox.p1.y, RIGHT);
Sector::current()->add_object(leaf2);
// if we're small, we die
if (mystate == STATE_NORMAL) {
sprite->set_action(dir == LEFT ? "squished-left" : "squished-right");
- bbox.set_size(42, 42);
+ bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height());
kill_squished(player);
return true;
}
return (int) action->surfaces[get_frame()]->get_height();
}
+float
+Sprite::get_current_hitbox_x_offset() const
+{
+ return action->x_offset;
+}
+
+float
+Sprite::get_current_hitbox_y_offset() const
+{
+ return action->y_offset;
+}
+
+float
+Sprite::get_current_hitbox_width() const
+{
+ return action->hitbox_w;
+}
+
+float
+Sprite::get_current_hitbox_height() const
+{
+ return action->hitbox_h;
+}
+
void
Sprite::set_fps(float new_fps)
{
int get_width() const;
int get_height() const;
+ /** return x-offset of current action's hitbox, relative to start of image */
+ float get_current_hitbox_x_offset() const;
+ /** return y-offset of current action's hitbox, relative to start of image */
+ float get_current_hitbox_y_offset() const;
+ /** return width of current action's hitbox */
+ float get_current_hitbox_width() const;
+ /** return height of current action's hitbox */
+ float get_current_hitbox_height() const;
+
/** Get current frame */
int get_frame() const
{ return (int)frame; }
{
x_offset = 0;
y_offset = 0;
+ hitbox_w = 0;
+ hitbox_h = 0;
z_order = 0;
fps = 10;
}
throw std::runtime_error(
"If there are more than one action, they need names!");
}
- lisp->get("x-offset", action->x_offset);
- lisp->get("y-offset", action->y_offset);
+ std::vector<float> hitbox;
+ if (lisp->get_vector("hitbox", hitbox)) {
+ if (hitbox.size() != 4) throw std::runtime_error("hitbox must specify exactly 4 coordinates");
+ action->x_offset = hitbox[0];
+ action->y_offset = hitbox[1];
+ action->hitbox_w = hitbox[2];
+ action->hitbox_h = hitbox[3];
+ }
lisp->get("z-order", action->z_order);
lisp->get("fps", action->fps);
throw std::runtime_error("Could not mirror action. Action not found\n"
"Mirror actions must be defined after the real one!");
} else {
+ float max_w = 0;
+ float max_h = 0;
for(int i = 0; static_cast<unsigned int>(i) < act_tmp->surfaces.size();
i++) {
Surface* surface = new Surface(*(act_tmp->surfaces[i]));
surface->hflip();
+ max_w = std::max(max_w, surface->get_width());
+ max_h = std::max(max_h, surface->get_height());
action->surfaces.push_back(surface);
}
+ if (action->hitbox_w < 1) action->hitbox_w = max_w;
+ if (action->hitbox_h < 1) action->hitbox_h = max_h;
}
} else { // Load images
std::vector<std::string> images;
throw std::runtime_error(msg.str());
}
+ float max_w = 0;
+ float max_h = 0;
for(std::vector<std::string>::size_type i = 0; i < images.size(); i++) {
- action->surfaces.push_back(new Surface(basedir + images[i]));
+ Surface* surface = new Surface(basedir + images[i]);
+ max_w = std::max(max_w, surface->get_width());
+ max_h = std::max(max_h, surface->get_height());
+ action->surfaces.push_back(surface);
}
+ if (action->hitbox_w < 1) action->hitbox_w = max_w;
+ if (action->hitbox_h < 1) action->hitbox_h = max_h;
}
actions[action->name] = action;
}
class SpriteData
{
public:
- /** cur has to be a pointer to data in the form of ((x-offset 5)
- (y-offset 10) ...) */
+ /** cur has to be a pointer to data in the form of ((hitbox 5 10 0 0) ...) */
SpriteData(const lisp::Lisp* cur, const std::string& basedir);
~SpriteData();
std::string name;
/** Position correction */
- int x_offset;
- int y_offset;
+ float x_offset;
+ float y_offset;
+
+ /** Hitbox width */
+ float hitbox_w;
+
+ /** Hitbox height */
+ float hitbox_h;
+
/** Drawing priority in queue */
int z_order;