From b51a3e05e9212c00c3bf7d00c6c2bf33fe8e2970 Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Sun, 30 Apr 2006 23:14:15 +0000 Subject: [PATCH] Badguys read hitbox from .sprite file SVN-Revision: 3478 --- data/images/creatures/angrystone/angrystone.sprite | 3 +++ .../bouncing_snowball/bouncing_snowball.sprite | 6 +++--- data/images/creatures/dart/dart.sprite | 4 ++-- data/images/creatures/darttrap/darttrap.sprite | 4 ++++ data/images/creatures/dispenser/dispenser.sprite | 10 +++++----- data/images/creatures/fish/fish.sprite | 8 ++++---- data/images/creatures/flame/flame.sprite | 1 + .../creatures/flying_snowball/flying_snowball.sprite | 8 ++++---- data/images/creatures/jumpy/jumpy.sprite | 16 ++++++++-------- data/images/creatures/kugelblitz/kugelblitz.sprite | 6 +++--- data/images/creatures/mr_bomb/bomb.sprite | 6 +++--- data/images/creatures/mr_bomb/mr_bomb.sprite | 8 ++++---- data/images/creatures/mr_iceblock/mr_iceblock.sprite | 12 ++++++------ data/images/creatures/mr_rocket/explosion.sprite | 4 ++-- data/images/creatures/mr_rocket/mr_rocket.sprite | 12 ++++++------ data/images/creatures/nolok/nolok.sprite | 12 ++++++------ data/images/creatures/plant/plant.sprite | 16 ++++++++-------- data/images/creatures/poison_ivy/poison_ivy.sprite | 8 ++++---- data/images/creatures/skullyhop/skullyhop.sprite | 16 ++++++++-------- data/images/creatures/snail/snail.sprite | 12 ++++++------ data/images/creatures/snowball/snowball.sprite | 8 ++++---- data/images/creatures/spidermite/spidermite.sprite | 8 ++++---- data/images/creatures/spiky/sleepingspiky.sprite | 16 ++++++++-------- data/images/creatures/spiky/spiky.sprite | 8 ++++---- data/images/creatures/stalactite/stalactite.sprite | 4 ++-- data/images/creatures/totem/totem.sprite | 6 ++++++ data/images/creatures/willowisp/willowisp.sprite | 3 +++ data/images/creatures/yeti/yeti.sprite | 18 +++++++++--------- data/images/creatures/zeekling/zeekling.sprite | 12 ++++++------ src/badguy/angrystone.cpp | 2 +- src/badguy/bomb.cpp | 2 +- src/badguy/bouncing_snowball.cpp | 4 ++-- src/badguy/dart.cpp | 4 ++-- src/badguy/darttrap.cpp | 2 +- src/badguy/dispenser.cpp | 2 +- src/badguy/fish.cpp | 4 ++-- src/badguy/flame.cpp | 2 +- src/badguy/flyingsnowball.cpp | 4 ++-- src/badguy/jumpy.cpp | 2 +- src/badguy/kugelblitz.cpp | 2 +- src/badguy/mrbomb.cpp | 4 ++-- src/badguy/mriceblock.cpp | 8 ++------ src/badguy/mrrocket.cpp | 4 ++-- src/badguy/nolok_01.cpp | 4 ++-- src/badguy/plant.cpp | 2 +- src/badguy/poisonivy.cpp | 4 ++-- src/badguy/rocketexplosion.cpp | 2 +- src/badguy/skullyhop.cpp | 4 ++-- src/badguy/snail.cpp | 4 ++-- src/badguy/snowball.cpp | 4 ++-- src/badguy/spidermite.cpp | 4 ++-- src/badguy/spiky.cpp | 2 +- src/badguy/sspiky.cpp | 2 +- src/badguy/stalactite.cpp | 2 +- src/badguy/totem.cpp | 12 +++++++----- src/badguy/willowisp.cpp | 2 +- src/badguy/yeti.cpp | 2 +- src/badguy/zeekling.cpp | 4 ++-- 58 files changed, 185 insertions(+), 170 deletions(-) diff --git a/data/images/creatures/angrystone/angrystone.sprite b/data/images/creatures/angrystone/angrystone.sprite index bccffabb1..63654d102 100644 --- a/data/images/creatures/angrystone/angrystone.sprite +++ b/data/images/creatures/angrystone/angrystone.sprite @@ -1,10 +1,13 @@ (supertux-sprite (action + (hitbox 0 0 87.8 87.8) (name "idle") (images "idle-0.png")) (action + (hitbox 0 0 87.8 87.8) (name "charging") (images "charging-0.png")) (action + (hitbox 0 0 87.8 87.8) (name "attacking") (images "attacking-0.png"))) diff --git a/data/images/creatures/bouncing_snowball/bouncing_snowball.sprite b/data/images/creatures/bouncing_snowball/bouncing_snowball.sprite index 3778be97f..65ab68acd 100644 --- a/data/images/creatures/bouncing_snowball/bouncing_snowball.sprite +++ b/data/images/creatures/bouncing_snowball/bouncing_snowball.sprite @@ -1,7 +1,7 @@ (supertux-sprite (action (name "left") - (hitbox 1 0 0 0) + (hitbox 1 0 31.8 31.8) (images "left-0.png" "left-1.png" "left-2.png" @@ -11,11 +11,11 @@ (action (name "right") - (hitbox 1 0 0 0) + (hitbox 1 0 31.8 31.8) (mirror-action "left")) (action (name "squished") - (hitbox 1 -19 0 0) + (hitbox 1 -19 31.8 31.8) (images "../snowball/squished-left.png")) ) diff --git a/data/images/creatures/dart/dart.sprite b/data/images/creatures/dart/dart.sprite index be1fe4967..624239554 100644 --- a/data/images/creatures/dart/dart.sprite +++ b/data/images/creatures/dart/dart.sprite @@ -1,12 +1,12 @@ (supertux-sprite (action (name "flying-left") - (hitbox 3 3 0 0) + (hitbox 3 3 9 1) (images "flying.png") ) (action (name "flying-right") - (hitbox 3 3 0 0) + (hitbox 3 3 9 1) (mirror-action "flying-left") ) ) diff --git a/data/images/creatures/darttrap/darttrap.sprite b/data/images/creatures/darttrap/darttrap.sprite index 7ea616524..157683f1c 100644 --- a/data/images/creatures/darttrap/darttrap.sprite +++ b/data/images/creatures/darttrap/darttrap.sprite @@ -1,13 +1,16 @@ (supertux-sprite (action + (hitbox 0 0 11 37) (name "idle-left") (images "idle.png") ) (action + (hitbox 0 0 11 37) (name "idle-right") (mirror-action "idle-left") ) (action + (hitbox 0 0 11 37) (name "loading-left") (images "idle.png" @@ -19,6 +22,7 @@ ) ) (action + (hitbox 0 0 11 37) (name "loading-right") (mirror-action "loading-left") ) diff --git a/data/images/creatures/dispenser/dispenser.sprite b/data/images/creatures/dispenser/dispenser.sprite index 358eca5a9..3a3875013 100644 --- a/data/images/creatures/dispenser/dispenser.sprite +++ b/data/images/creatures/dispenser/dispenser.sprite @@ -1,27 +1,27 @@ (supertux-sprite (action (name "dropper") - (hitbox 0 0 0 0) + (hitbox 0 0 32 32) (images "dropper.png")) (action (name "working-left") - (hitbox 0 0 0 0) + (hitbox 0 0 32 32) (images "working.png")) (action (name "broken-left") - (hitbox 0 0 0 0) + (hitbox 0 0 32 32) (images "broken.png")) (action (name "working-right") - (hitbox 0 0 0 0) + (hitbox 0 0 32 32) (mirror-action "working-left")) (action (name "broken-right") - (hitbox 0 0 0 0) + (hitbox 0 0 32 32) (mirror-action "broken-left")) ) diff --git a/data/images/creatures/fish/fish.sprite b/data/images/creatures/fish/fish.sprite index ea9d3ab9c..debc76d29 100644 --- a/data/images/creatures/fish/fish.sprite +++ b/data/images/creatures/fish/fish.sprite @@ -1,23 +1,23 @@ (supertux-sprite (action (name "normal") - (hitbox 2 3 0 0) + (hitbox 2 3 31.8 31.8) (images "left-0.png" "left-1.png")) (action (name "down") - (hitbox 2 11 0 0) + (hitbox 2 11 31.8 31.8) (images "down.png")) (action (name "iced") - (hitbox 2 3 0 0) + (hitbox 2 3 31.8 31.8) (images "iced-left.png")) (action (name "iced-down") - (hitbox 2 11 0 0) + (hitbox 2 11 31.8 31.8) (images "iced-down.png")) ) diff --git a/data/images/creatures/flame/flame.sprite b/data/images/creatures/flame/flame.sprite index 4f6bd8af1..96b958277 100644 --- a/data/images/creatures/flame/flame.sprite +++ b/data/images/creatures/flame/flame.sprite @@ -1,5 +1,6 @@ (supertux-sprite (action + (hitbox 0 0 31.8 31.8) (name "normal") (images "flame-0.png" "flame-1.png")) diff --git a/data/images/creatures/flying_snowball/flying_snowball.sprite b/data/images/creatures/flying_snowball/flying_snowball.sprite index 5a3c335bd..eda5ab99c 100644 --- a/data/images/creatures/flying_snowball/flying_snowball.sprite +++ b/data/images/creatures/flying_snowball/flying_snowball.sprite @@ -1,22 +1,22 @@ (supertux-sprite (action (name "left") - (hitbox 4 3 0 0) + (hitbox 4 3 31.8 31.8) (images "left-0.png" "left-1.png")) (action (name "right") - (hitbox 4 3 0 0) + (hitbox 4 3 31.8 31.8) (mirror-action "left")) (action (name "squished-left") - (hitbox 4 -12 0 0) + (hitbox 4 -12 31.8 31.8) (images "squished-left.png")) (action (name "squished-right") - (hitbox 4 -12 0 0) + (hitbox 4 -12 31.8 31.8) (mirror-action "squished-left")) ) diff --git a/data/images/creatures/jumpy/jumpy.sprite b/data/images/creatures/jumpy/jumpy.sprite index 8b881fd9b..0f0bd89c2 100644 --- a/data/images/creatures/jumpy/jumpy.sprite +++ b/data/images/creatures/jumpy/jumpy.sprite @@ -2,42 +2,42 @@ (action (name "left-up") - (hitbox 7 8 0 0) + (hitbox 7 8 31.8 31.8) (images "left-up.png")) (action (name "right-up") - (hitbox 7 8 0 0) + (hitbox 7 8 31.8 31.8) (mirror-action "left-up")) (action (name "left-down") - (hitbox 7 8 0 0) + (hitbox 7 8 31.8 31.8) (images "left-down.png")) (action (name "right-down") - (hitbox 7 8 0 0) + (hitbox 7 8 31.8 31.8) (mirror-action "left-down")) (action (name "left-middle") - (hitbox 7 8 0 0) + (hitbox 7 8 31.8 31.8) (images "left-middle.png")) (action (name "right-middle") - (hitbox 7 8 0 0) + (hitbox 7 8 31.8 31.8) (mirror-action "left-middle")) (action (name "left-iced") - (hitbox 7 8 0 0) + (hitbox 7 8 31.8 31.8) (images "iced-left-up.png")) (action (name "right-iced") - (hitbox 7 8 0 0) + (hitbox 7 8 31.8 31.8) (mirror-action "left-iced")) ) diff --git a/data/images/creatures/kugelblitz/kugelblitz.sprite b/data/images/creatures/kugelblitz/kugelblitz.sprite index 6f8d560be..e29cc4c7c 100644 --- a/data/images/creatures/kugelblitz/kugelblitz.sprite +++ b/data/images/creatures/kugelblitz/kugelblitz.sprite @@ -1,21 +1,21 @@ (supertux-sprite (action (name "falling") - (hitbox 0 0 0 0) + (hitbox 0 0 63.8 63.8) (images "falling-0.png" "falling-1.png" "falling-2.png")) (action (name "flying") - (hitbox 0 0 0 0) + (hitbox 0 0 63.8 63.8) (images "flying-0.png" "flying-1.png" "flying-2.png")) (action (name "pop") - (hitbox 0 0 0 0) + (hitbox 0 0 63.8 63.8) (fps 20) (images "pop-0.png" "pop-1.png" diff --git a/data/images/creatures/mr_bomb/bomb.sprite b/data/images/creatures/mr_bomb/bomb.sprite index 18c98ab3b..7ab6a4d57 100644 --- a/data/images/creatures/mr_bomb/bomb.sprite +++ b/data/images/creatures/mr_bomb/bomb.sprite @@ -3,20 +3,20 @@ (action (name "ticking-left") (fps 15.0) - (hitbox 3 8 0 0) + (hitbox 3 8 31.8 31.8) (images "exploding-left-0.png" "exploding-left-1.png")) (action (name "ticking-right") (fps 15.0) - (hitbox 10 8 0 0) + (hitbox 10 8 31.8 31.8) (mirror-action "ticking-left")) (action (name "explosion") (fps 15.0) - (hitbox 32 32 0 0) + (hitbox 32 32 31.8 31.8) (images "explosion-0.png" "explosion-1.png")) ) diff --git a/data/images/creatures/mr_bomb/mr_bomb.sprite b/data/images/creatures/mr_bomb/mr_bomb.sprite index a590af20c..4ae2fb5c6 100644 --- a/data/images/creatures/mr_bomb/mr_bomb.sprite +++ b/data/images/creatures/mr_bomb/mr_bomb.sprite @@ -2,7 +2,7 @@ (action (name "left") (fps 10.0) - (hitbox 3 12 0 0) + (hitbox 3 12 31.8 31.8) (images "left-0.png" "left-1.png" "left-2.png" @@ -11,17 +11,17 @@ (action (name "right") (fps 10.0) - (hitbox 7 12 0 0) + (hitbox 7 12 31.8 31.8) (mirror-action "left")) (action (name "iced-left") - (hitbox 3 12 0 0) + (hitbox 3 12 31.8 31.8) (images "iced-left.png")) (action (name "iced-right") - (hitbox 7 12 0 0) + (hitbox 7 12 31.8 31.8) (mirror-action "iced-left")) ) diff --git a/data/images/creatures/mr_iceblock/mr_iceblock.sprite b/data/images/creatures/mr_iceblock/mr_iceblock.sprite index 37e04518c..77b5fea64 100644 --- a/data/images/creatures/mr_iceblock/mr_iceblock.sprite +++ b/data/images/creatures/mr_iceblock/mr_iceblock.sprite @@ -1,28 +1,28 @@ (supertux-sprite (action (name "left") - (hitbox 2 3 0 0) + (hitbox 2 3 31.8 31.8) (images "left-0.png" "left-1.png" "left-2.png" "left-1.png")) (action (name "right") - (hitbox 2 3 0 0) + (hitbox 2 3 31.8 31.8) (mirror-action "left")) (action (name "falling-left") - (hitbox 2 3 0 0) + (hitbox 2 3 31.8 31.8) (images "flat-left.png")) (action (name "falling-right") - (hitbox 2 3 0 0) + (hitbox 2 3 31.8 31.8) (mirror-action "falling-left")) (action (name "flat-left") - (hitbox 2 3 0 0) + (hitbox 2 3 31.8 31.8) (images "flat-left.png")) (action (name "flat-right") - (hitbox 2 3 0 0) + (hitbox 2 3 31.8 31.8) (mirror-action "falling-left"))) diff --git a/data/images/creatures/mr_rocket/explosion.sprite b/data/images/creatures/mr_rocket/explosion.sprite index d7004d1c2..3d1a9c163 100644 --- a/data/images/creatures/mr_rocket/explosion.sprite +++ b/data/images/creatures/mr_rocket/explosion.sprite @@ -2,14 +2,14 @@ (action (name "explosion-left") (fps 15.0) - (hitbox 0 32 0 0) + (hitbox 0 32 31.8 31.8) (images "explosion-0.png" "explosion-1.png") ) (action (name "explosion-right") (fps 15.0) - (hitbox 0 32 0 0) + (hitbox 0 32 31.8 31.8) (mirror-action "explosion-left") ) ) diff --git a/data/images/creatures/mr_rocket/mr_rocket.sprite b/data/images/creatures/mr_rocket/mr_rocket.sprite index b44050479..e2069c497 100644 --- a/data/images/creatures/mr_rocket/mr_rocket.sprite +++ b/data/images/creatures/mr_rocket/mr_rocket.sprite @@ -2,7 +2,7 @@ (action (name "left") (fps 15.0) - (hitbox 3 12 0 0) + (hitbox 3 12 31.8 31.8) (images "flying-0.png" "flying-1.png" "flying-2.png" @@ -12,29 +12,29 @@ (action (name "right") (fps 10.0) - (hitbox 7 12 0 0) + (hitbox 7 12 31.8 31.8) (mirror-action "left") ) (action (name "squished-left") - (hitbox 7 0 0 0) + (hitbox 7 0 31.8 31.8) (images "squished.png") ) (action (name "squished-right") - (hitbox 7 0 0 0) + (hitbox 7 0 31.8 31.8) (mirror-action "squished-left")) (action (name "collision-left") - (hitbox 3 12 0 0) + (hitbox 3 12 31.8 31.8) (images "collision.png")) (action (name "collision-right") - (hitbox 3 12 0 0) + (hitbox 3 12 31.8 31.8) (mirror-action "squished-left") ) ) diff --git a/data/images/creatures/nolok/nolok.sprite b/data/images/creatures/nolok/nolok.sprite index dab1801dd..b7b1d251e 100644 --- a/data/images/creatures/nolok/nolok.sprite +++ b/data/images/creatures/nolok/nolok.sprite @@ -2,7 +2,7 @@ (action (name "left") (fps 6) - (hitbox 0 40 0 0) + (hitbox 0 40 31.8 63.8) (images "walk-0.png" "walk-1.png" "walk-2.png" @@ -14,27 +14,27 @@ (action (name "right") (fps 6) - (hitbox 0 40 0 0) + (hitbox 0 40 31.8 63.8) (mirror-action "left") ) (action (name "stand") - (hitbox 0 40 0 0) + (hitbox 0 40 31.8 63.8) (images "walk-0.png") ) (action (name "throw") (fps 6) - (hitbox 0 40 0 0) + (hitbox 0 40 31.8 63.8) (images "jump-0.png" ) ) (action (name "jump") - (hitbox 0 40 0 0) + (hitbox 0 40 31.8 63.8) (images "jump-0.png" "jump-1.png" ) @@ -42,7 +42,7 @@ (action (name "dead") - (hitbox 0 0 0 0) + (hitbox 0 0 31.8 63.8) (images "throw-0.png") ) ) diff --git a/data/images/creatures/plant/plant.sprite b/data/images/creatures/plant/plant.sprite index 36b54aaf9..27d1df3e7 100644 --- a/data/images/creatures/plant/plant.sprite +++ b/data/images/creatures/plant/plant.sprite @@ -1,34 +1,34 @@ (supertux-sprite (action (name "left") - (hitbox 6 10 0 0) + (hitbox 6 10 31.8 31.8) (images "left-0.png" "left-1.png" "left-2.png")) (action (name "right") - (hitbox 6 10 0 0) + (hitbox 6 10 31.8 31.8) (mirror-action "left")) (action (name "iced-left") - (hitbox 6 10 0 0) + (hitbox 6 10 31.8 31.8) (images "iced-left.png")) (action (name "iced-right") - (hitbox 6 10 0 0) + (hitbox 6 10 31.8 31.8) (mirror-action "iced-left") ) (action (name "sleeping-left") - (hitbox 6 10 0 0) + (hitbox 6 10 31.8 31.8) (images "sleeping-left.png")) (action (name "sleeping-right") - (hitbox 6 10 0 0) + (hitbox 6 10 31.8 31.8) (mirror-action "sleeping-left")) (action (name "waking-left") - (hitbox 6 10 0 0) + (hitbox 6 10 31.8 31.8) (fps 6.0) (images "waking-left-0.png" "waking-left-1.png" @@ -36,6 +36,6 @@ (action (name "waking-right") (fps 6.0) - (hitbox 6 10 0 0) + (hitbox 6 10 31.8 31.8) (mirror-action "waking-left")) ) diff --git a/data/images/creatures/poison_ivy/poison_ivy.sprite b/data/images/creatures/poison_ivy/poison_ivy.sprite index 9a46d1dea..8eae89065 100644 --- a/data/images/creatures/poison_ivy/poison_ivy.sprite +++ b/data/images/creatures/poison_ivy/poison_ivy.sprite @@ -1,23 +1,23 @@ (supertux-sprite (action (name "left") - (hitbox 2 4 0 0) + (hitbox 2 4 31.8 31.8) (images "left-0.png" "left-1.png" "left-2.png")) (action (name "right") - (hitbox 2 4 0 0) + (hitbox 2 4 31.8 31.8) (mirror-action "left")) (action (name "squished-left") - (hitbox 0 3 0 0) + (hitbox 0 3 31.8 31.8) (images "squished.png")) (action (name "squished-right") - (hitbox 0 3 0 0) + (hitbox 0 3 31.8 31.8) (mirror-action "squished-left") ) ) diff --git a/data/images/creatures/skullyhop/skullyhop.sprite b/data/images/creatures/skullyhop/skullyhop.sprite index 20b538a64..bf2982a87 100644 --- a/data/images/creatures/skullyhop/skullyhop.sprite +++ b/data/images/creatures/skullyhop/skullyhop.sprite @@ -1,36 +1,36 @@ (supertux-sprite (action (name "standing-left") - (hitbox 0 0 0 0) + (hitbox 0 0 33.8 43.8) (images "standing-0.png")) (action (name "standing-right") - (hitbox 0 0 0 0) + (hitbox 0 0 33.8 43.8) (mirror-action "standing-left")) (action (name "charging-left") - (hitbox 0 0 0 0) + (hitbox 0 0 33.8 43.8) (fps 10.0) (images "charging-0.png" "charging-1.png")) (action (name "charging-right") (fps 10.0) - (hitbox 0 0 0 0) + (hitbox 0 0 33.8 43.8) (mirror-action "charging-left")) (action (name "jumping-left") - (hitbox 0 0 0 0) + (hitbox 0 0 33.8 43.8) (images "jumping-0.png")) (action (name "jumping-right") - (hitbox 0 0 0 0) + (hitbox 0 0 33.8 43.8) (mirror-action "jumping-left")) (action (name "squished-left") - (hitbox 0 -14 0 0) + (hitbox 0 -14 33.8 43.8) (images "squished-0.png")) (action (name "squished-right") - (hitbox 0 -14 0 0) + (hitbox 0 -14 33.8 43.8) (mirror-action "squished-left"))) diff --git a/data/images/creatures/snail/snail.sprite b/data/images/creatures/snail/snail.sprite index b03b31e0e..56efd7dfd 100644 --- a/data/images/creatures/snail/snail.sprite +++ b/data/images/creatures/snail/snail.sprite @@ -1,18 +1,18 @@ (supertux-sprite (action (name "left") - (hitbox 2 3 0 0) + (hitbox 2 3 31.8 31.8) (images "snowsnail1.png" "snowsnail2.png" "snowsnail3.png" )) (action (name "right") - (hitbox 2 3 0 0) + (hitbox 2 3 31.8 31.8) (mirror-action "left")) (action (name "falling-left") - (hitbox 2 3 0 0) + (hitbox 2 3 31.8 31.8) (images "snowsnail_flip1.png" "snowsnail_flip2.png" "snowsnail_flip3.png" @@ -23,11 +23,11 @@ )) (action (name "falling-right") - (hitbox 2 3 0 0) + (hitbox 2 3 31.8 31.8) (mirror-action "falling-left")) (action (name "flat-left") - (hitbox 2 3 0 0) + (hitbox 2 3 31.8 31.8) (images "snowsnail_flip1.png" "snowsnail_flip2.png" "snowsnail_flip3.png" @@ -38,5 +38,5 @@ )) (action (name "flat-right") - (hitbox 2 3 0 0) + (hitbox 2 3 31.8 31.8) (mirror-action "falling-left"))) diff --git a/data/images/creatures/snowball/snowball.sprite b/data/images/creatures/snowball/snowball.sprite index 957366fe3..d10de90c9 100644 --- a/data/images/creatures/snowball/snowball.sprite +++ b/data/images/creatures/snowball/snowball.sprite @@ -1,24 +1,24 @@ (supertux-sprite (action (name "left") - (hitbox 2 4 0 0) + (hitbox 2 4 31.8 31.8) (images "left-0.png" "left-1.png" "left-2.png") ) (action (name "right") - (hitbox 2 4 0 0) + (hitbox 2 4 31.8 31.8) (mirror-action "left") ) (action (name "squished-left") - (hitbox 1 -19 0 0) + (hitbox 1 -19 31.8 31.8) (images "squished-left.png") ) (action (name "squished-right") - (hitbox 1 -19 0 0) + (hitbox 1 -19 31.8 31.8) (mirror-action "squished-left") ) ) diff --git a/data/images/creatures/spidermite/spidermite.sprite b/data/images/creatures/spidermite/spidermite.sprite index 07f57ab2a..74a4c96ef 100644 --- a/data/images/creatures/spidermite/spidermite.sprite +++ b/data/images/creatures/spidermite/spidermite.sprite @@ -1,21 +1,21 @@ (supertux-sprite (action (name "left") - (hitbox 4 3 0 0) + (hitbox 4 3 31.8 31.8) (images "spidermite.png" "spidermite0.png" "spidermite1.png" "spidermite0.png")) (action (name "right") - (hitbox 4 3 0 0) + (hitbox 4 3 31.8 31.8) (mirror-action "left")) (action (name "squished-left") - (hitbox 4 -12 0 0) + (hitbox 4 -12 31.8 31.8) (images "spidermite-squish.png")) (action (name "squished-right") - (hitbox 4 -12 0 0) + (hitbox 4 -12 31.8 31.8) (mirror-action "squished-left"))) diff --git a/data/images/creatures/spiky/sleepingspiky.sprite b/data/images/creatures/spiky/sleepingspiky.sprite index 36b54aaf9..27d1df3e7 100644 --- a/data/images/creatures/spiky/sleepingspiky.sprite +++ b/data/images/creatures/spiky/sleepingspiky.sprite @@ -1,34 +1,34 @@ (supertux-sprite (action (name "left") - (hitbox 6 10 0 0) + (hitbox 6 10 31.8 31.8) (images "left-0.png" "left-1.png" "left-2.png")) (action (name "right") - (hitbox 6 10 0 0) + (hitbox 6 10 31.8 31.8) (mirror-action "left")) (action (name "iced-left") - (hitbox 6 10 0 0) + (hitbox 6 10 31.8 31.8) (images "iced-left.png")) (action (name "iced-right") - (hitbox 6 10 0 0) + (hitbox 6 10 31.8 31.8) (mirror-action "iced-left") ) (action (name "sleeping-left") - (hitbox 6 10 0 0) + (hitbox 6 10 31.8 31.8) (images "sleeping-left.png")) (action (name "sleeping-right") - (hitbox 6 10 0 0) + (hitbox 6 10 31.8 31.8) (mirror-action "sleeping-left")) (action (name "waking-left") - (hitbox 6 10 0 0) + (hitbox 6 10 31.8 31.8) (fps 6.0) (images "waking-left-0.png" "waking-left-1.png" @@ -36,6 +36,6 @@ (action (name "waking-right") (fps 6.0) - (hitbox 6 10 0 0) + (hitbox 6 10 31.8 31.8) (mirror-action "waking-left")) ) diff --git a/data/images/creatures/spiky/spiky.sprite b/data/images/creatures/spiky/spiky.sprite index 6b2bafcd9..60a8aa466 100644 --- a/data/images/creatures/spiky/spiky.sprite +++ b/data/images/creatures/spiky/spiky.sprite @@ -1,21 +1,21 @@ (supertux-sprite (action (name "left") - (hitbox 6 10 0 0) + (hitbox 6 10 31.8 31.8) (images "left-0.png" "left-1.png" "left-2.png")) (action (name "right") - (hitbox 6 10 0 0) + (hitbox 6 10 31.8 31.8) (mirror-action "left")) (action (name "iced-left") - (hitbox 6 10 0 0) + (hitbox 6 10 31.8 31.8) (images "iced-left.png")) (action (name "iced-right") - (hitbox 6 10 0 0) + (hitbox 6 10 31.8 31.8) (mirror-action "iced-left") ) ) diff --git a/data/images/creatures/stalactite/stalactite.sprite b/data/images/creatures/stalactite/stalactite.sprite index ec258ade3..ed255319c 100644 --- a/data/images/creatures/stalactite/stalactite.sprite +++ b/data/images/creatures/stalactite/stalactite.sprite @@ -1,9 +1,9 @@ (supertux-sprite (action (name "normal") - (hitbox 0 0 0 0) + (hitbox 0 0 31.8 31.8) (images "falling.png")) (action (name "squished") - (hitbox 0 16 0 0) + (hitbox 0 16 31.8 31.8) (images "broken.png"))) diff --git a/data/images/creatures/totem/totem.sprite b/data/images/creatures/totem/totem.sprite index e4e9f9480..b707d0c9e 100644 --- a/data/images/creatures/totem/totem.sprite +++ b/data/images/creatures/totem/totem.sprite @@ -1,25 +1,31 @@ (supertux-sprite (action + (hitbox 0 0 48 49) (name "walking-left") (images "walking1.png" "walking2.png" "walking3.png" "walking4.png") ) (action + (hitbox 0 0 48 49) (name "walking-right") (mirror-action "walking-left") ) (action + (hitbox 0 0 48 49) (name "stacked-left") (images "stacked.png") ) (action + (hitbox 0 0 48 49) (name "stacked-right") (mirror-action "stacked-left") ) (action + (hitbox 0 0 48 45) (name "squished-left") (images "squished.png") ) (action + (hitbox 0 0 48 45) (name "squished-right") (mirror-action "squished-left") ) diff --git a/data/images/creatures/willowisp/willowisp.sprite b/data/images/creatures/willowisp/willowisp.sprite index b7a100c0c..9408787fd 100644 --- a/data/images/creatures/willowisp/willowisp.sprite +++ b/data/images/creatures/willowisp/willowisp.sprite @@ -1,5 +1,6 @@ (supertux-sprite (action + (hitbox 0 0 31.8 31.8) (name "idle") (images "idle-0.png" @@ -9,6 +10,7 @@ ) ) (action + (hitbox 0 0 31.8 31.8) (name "vanishing") (images "vanishing-0.png" @@ -18,6 +20,7 @@ ) ) (action + (hitbox 0 0 31.8 31.8) (name "warping") (images "warping-0.png" diff --git a/data/images/creatures/yeti/yeti.sprite b/data/images/creatures/yeti/yeti.sprite index 975146f41..cdaef0a11 100644 --- a/data/images/creatures/yeti/yeti.sprite +++ b/data/images/creatures/yeti/yeti.sprite @@ -2,7 +2,7 @@ (action (name "run-right") (fps 4.0) - (hitbox 17 12 0 0) + (hitbox 17 12 60 90) (images "y1.png" "y2.png" @@ -17,43 +17,43 @@ (name "run-left") (mirror-action "run-right") (fps 4.0) - (hitbox 17 12 0 0) + (hitbox 17 12 60 90) ) (action (name "jump-right") (images "yeti_jump.png" ) - (hitbox 17 12 0 0) + (hitbox 17 12 60 90) ) (action (name "jump-left") (mirror-action "jump-right") - (hitbox 17 12 0 0) + (hitbox 17 12 60 90) ) (action (name "stand-right") (images "y.png" ) - (hitbox 17 12 0 0) + (hitbox 17 12 60 90) ) (action (name "stand-left") (mirror-action "stand-right") - (hitbox 17 12 0 0) + (hitbox 17 12 60 90) ) (action (name "stomp-right") (images "y-jump.png" ) - (hitbox 17 12 0 0) + (hitbox 17 12 60 90) ) (action (name "stomp-left") (mirror-action "stomp-right") - (hitbox 17 12 0 0) + (hitbox 17 12 60 90) ) (action (name "dead") @@ -66,6 +66,6 @@ "busted2.png" ) - (hitbox 300 400 0 0) + (hitbox 300 400 60 90) ) ) diff --git a/data/images/creatures/zeekling/zeekling.sprite b/data/images/creatures/zeekling/zeekling.sprite index a818c3644..020b6d08d 100644 --- a/data/images/creatures/zeekling/zeekling.sprite +++ b/data/images/creatures/zeekling/zeekling.sprite @@ -2,30 +2,30 @@ (supertux-sprite (action (name "left") - (hitbox 2 4 0 0) + (hitbox 2 4 63.8 50.8) (images "left-0.png" "left-1.png" "left-2.png" "left-3.png")) (action (name "right") - (hitbox 2 4 0 0) + (hitbox 2 4 63.8 50.8) (mirror-action "left")) (action (name "squished-left") - (hitbox 2 -19 0 0) + (hitbox 2 -19 63.8 50.8) (images "squished.png")) (action (name "squished-right") - (hitbox 2 -19 0 0) + (hitbox 2 -19 63.8 50.8) (mirror-action "squished-left")) (action (name "diving-left") - (hitbox 2 4 0 0) + (hitbox 2 4 63.8 50.8) (images "diving.png")) (action (name "diving-right") - (hitbox 2 4 0 0) + (hitbox 2 4 63.8 50.8) (mirror-action "diving-left") ) ) diff --git a/src/badguy/angrystone.cpp b/src/badguy/angrystone.cpp index 2f9dc8a83..a44e8363e 100644 --- a/src/badguy/angrystone.cpp +++ b/src/badguy/angrystone.cpp @@ -32,8 +32,8 @@ AngryStone::AngryStone(const lisp::Lisp& reader) { reader.get("x", start_position.x); reader.get("y", start_position.y); - bbox.set_size(87.8, 87.8); // sprite is (88px, 88px) sprite = sprite_manager->create("images/creatures/angrystone/angrystone.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); state = IDLE; } diff --git a/src/badguy/bomb.cpp b/src/badguy/bomb.cpp index f96719f58..e06508669 100644 --- a/src/badguy/bomb.cpp +++ b/src/badguy/bomb.cpp @@ -28,8 +28,8 @@ Bomb::Bomb(const Vector& pos, Direction dir) { start_position = pos; bbox.set_pos(pos); - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/mr_bomb/bomb.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); state = STATE_TICKING; timer.start(TICKINGTIME); this->dir = dir; diff --git a/src/badguy/bouncing_snowball.cpp b/src/badguy/bouncing_snowball.cpp index 0633b5f55..ba9536aef 100644 --- a/src/badguy/bouncing_snowball.cpp +++ b/src/badguy/bouncing_snowball.cpp @@ -28,8 +28,8 @@ BouncingSnowball::BouncingSnowball(const lisp::Lisp& reader) { reader.get("x", start_position.x); reader.get("y", start_position.y); - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/bouncing_snowball/bouncing_snowball.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); set_direction = false; } @@ -37,8 +37,8 @@ BouncingSnowball::BouncingSnowball(float pos_x, float pos_y, Direction d) { start_position.x = pos_x; start_position.y = pos_y; - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/bouncing_snowball/bouncing_snowball.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); set_direction = true; initial_direction = d; } diff --git a/src/badguy/dart.cpp b/src/badguy/dart.cpp index 5fc4d2ad3..1c6ab0d4f 100644 --- a/src/badguy/dart.cpp +++ b/src/badguy/dart.cpp @@ -30,8 +30,8 @@ Dart::Dart(const lisp::Lisp& reader) : set_direction(false), parent(0), soundSou { reader.get("x", start_position.x); reader.get("y", start_position.y); - bbox.set_size(9, 1); sprite = sprite_manager->create("images/creatures/dart/dart.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); physic.enable_gravity(false); countMe = false; } @@ -40,8 +40,8 @@ Dart::Dart(float pos_x, float pos_y, Direction d, const BadGuy* parent = 0) : se { start_position.x = pos_x; start_position.y = pos_y; - bbox.set_size(9, 1); sprite = sprite_manager->create("images/creatures/dart/dart.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); physic.enable_gravity(false); countMe = false; } diff --git a/src/badguy/darttrap.cpp b/src/badguy/darttrap.cpp index fa76173a6..ad1ea9570 100644 --- a/src/badguy/darttrap.cpp +++ b/src/badguy/darttrap.cpp @@ -33,8 +33,8 @@ DartTrap::DartTrap(const lisp::Lisp& reader) : set_direction(true), initial_dire reader.get("initial-delay", initial_delay); reader.get("fire-delay", fire_delay); reader.get("ammo", ammo); - bbox.set_size(11, 37); sprite = sprite_manager->create("images/creatures/darttrap/darttrap.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); countMe = false; } diff --git a/src/badguy/dispenser.cpp b/src/badguy/dispenser.cpp index 7cb48db06..4ead78e1a 100644 --- a/src/badguy/dispenser.cpp +++ b/src/badguy/dispenser.cpp @@ -36,12 +36,12 @@ Dispenser::Dispenser(const lisp::Lisp& reader) reader.get("y", start_position.y); reader.get("cycle", cycle); reader.get("badguy", badguy); - bbox.set_size(32, 32); sprite = sprite_manager->create("images/creatures/dispenser/dispenser.sprite"); if (badguy == "mrrocket") { sprite->set_action(dir == LEFT ? "working-left" : "working-right"); } else {sprite->set_action("dropper");} + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); countMe = false; } diff --git a/src/badguy/fish.cpp b/src/badguy/fish.cpp index af5c93b6e..d70ad8a0d 100644 --- a/src/badguy/fish.cpp +++ b/src/badguy/fish.cpp @@ -30,8 +30,8 @@ Fish::Fish(const lisp::Lisp& reader) { reader.get("x", start_position.x); reader.get("y", start_position.y); - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/fish/fish.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); physic.enable_gravity(true); } @@ -39,8 +39,8 @@ Fish::Fish(float pos_x, float pos_y) { start_position.x = pos_x; start_position.y = pos_y; - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/fish/fish.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); physic.enable_gravity(true); } diff --git a/src/badguy/flame.cpp b/src/badguy/flame.cpp index c4097d66a..c88e11867 100644 --- a/src/badguy/flame.cpp +++ b/src/badguy/flame.cpp @@ -31,8 +31,8 @@ Flame::Flame(const lisp::Lisp& reader) reader.get("speed", speed); bbox.set_pos(Vector(start_position.x + cos(angle) * radius, start_position.y + sin(angle) * radius)); - bbox.set_size(32, 32); sprite = sprite_manager->create("images/creatures/flame/flame.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); countMe = false; layer = LAYER_FLOATINGOBJECTS; } diff --git a/src/badguy/flyingsnowball.cpp b/src/badguy/flyingsnowball.cpp index 74cbbc2f7..a9ef465dc 100644 --- a/src/badguy/flyingsnowball.cpp +++ b/src/badguy/flyingsnowball.cpp @@ -30,8 +30,8 @@ FlyingSnowBall::FlyingSnowBall(const lisp::Lisp& reader) { reader.get("x", start_position.x); reader.get("y", start_position.y); - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/flying_snowball/flying_snowball.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); physic.enable_gravity(false); } @@ -39,8 +39,8 @@ FlyingSnowBall::FlyingSnowBall(float pos_x, float pos_y) { start_position.x = pos_x; start_position.y = pos_y; - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/flying_snowball/flying_snowball.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); physic.enable_gravity(false); } diff --git a/src/badguy/jumpy.cpp b/src/badguy/jumpy.cpp index b1afc2d72..350b39d38 100644 --- a/src/badguy/jumpy.cpp +++ b/src/badguy/jumpy.cpp @@ -30,8 +30,8 @@ Jumpy::Jumpy(const lisp::Lisp& reader) { reader.get("x", start_position.x); reader.get("y", start_position.y); - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/jumpy/jumpy.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); } void diff --git a/src/badguy/kugelblitz.cpp b/src/badguy/kugelblitz.cpp index 558c56231..10c4ef846 100644 --- a/src/badguy/kugelblitz.cpp +++ b/src/badguy/kugelblitz.cpp @@ -38,9 +38,9 @@ Kugelblitz::Kugelblitz(const lisp::Lisp& reader) { reader.get("x", start_position.x); start_position.y = 0; //place above visible area - bbox.set_size(63.8, 63.8); sprite = sprite_manager->create("images/creatures/kugelblitz/kugelblitz.sprite"); sprite->set_action("falling"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); physic.enable_gravity(false); } diff --git a/src/badguy/mrbomb.cpp b/src/badguy/mrbomb.cpp index 67722369b..cb6954639 100644 --- a/src/badguy/mrbomb.cpp +++ b/src/badguy/mrbomb.cpp @@ -28,8 +28,8 @@ MrBomb::MrBomb(const lisp::Lisp& reader) { reader.get("x", start_position.x); reader.get("y", start_position.y); - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/mr_bomb/mr_bomb.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); set_direction = false; } @@ -37,8 +37,8 @@ MrBomb::MrBomb(float pos_x, float pos_y, Direction d) { start_position.x = pos_x; start_position.y = pos_y; - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/mr_bomb/mr_bomb.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); set_direction = true; initial_direction = d; } diff --git a/src/badguy/mriceblock.cpp b/src/badguy/mriceblock.cpp index 74b515dda..f078f8f0d 100644 --- a/src/badguy/mriceblock.cpp +++ b/src/badguy/mriceblock.cpp @@ -33,8 +33,8 @@ MrIceBlock::MrIceBlock(const lisp::Lisp& reader) { reader.get("x", start_position.x); reader.get("y", start_position.y); - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/mr_iceblock/mr_iceblock.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); set_direction = false; } @@ -43,8 +43,8 @@ MrIceBlock::MrIceBlock(float pos_x, float pos_y, Direction d) { start_position.x = pos_x; start_position.y = pos_y; - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/mr_iceblock/mr_iceblock.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); set_direction = true; initial_direction = d; } @@ -233,10 +233,6 @@ MrIceBlock::set_state(IceState state) else flags &= ~FLAG_PORTABLE; - if(ice_state == ICESTATE_KICKED) { - bbox.set_size(31.8, 31.8); - } - switch(state) { case ICESTATE_NORMAL: physic.set_velocity_x(dir == LEFT ? -WALKSPEED : WALKSPEED); diff --git a/src/badguy/mrrocket.cpp b/src/badguy/mrrocket.cpp index 92addfe0d..9bc80ccca 100644 --- a/src/badguy/mrrocket.cpp +++ b/src/badguy/mrrocket.cpp @@ -27,8 +27,8 @@ MrRocket::MrRocket(const lisp::Lisp& reader) { reader.get("x", start_position.x); reader.get("y", start_position.y); - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/mr_rocket/mr_rocket.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); set_direction = false; } @@ -36,8 +36,8 @@ MrRocket::MrRocket(float pos_x, float pos_y, Direction d) { start_position.x = pos_x; start_position.y = pos_y; - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/mr_rocket/mr_rocket.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); set_direction = true; initial_direction = d; } diff --git a/src/badguy/nolok_01.cpp b/src/badguy/nolok_01.cpp index 77858d6fd..65b4f14f0 100644 --- a/src/badguy/nolok_01.cpp +++ b/src/badguy/nolok_01.cpp @@ -36,8 +36,8 @@ Nolok_01::Nolok_01(const lisp::Lisp& reader) { reader.get("x", start_position.x); reader.get("y", start_position.y); - bbox.set_size(31.8, 63.8); sprite = sprite_manager->create("images/creatures/nolok/nolok.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); countMe = false; } @@ -45,8 +45,8 @@ Nolok_01::Nolok_01(float pos_x, float pos_y) { start_position.x = pos_x; start_position.y = pos_y; - bbox.set_size(31.8, 63.8); sprite = sprite_manager->create("images/creatures/nolok/nolok.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); countMe = false; } diff --git a/src/badguy/plant.cpp b/src/badguy/plant.cpp index 95fb00857..0f1cce40c 100644 --- a/src/badguy/plant.cpp +++ b/src/badguy/plant.cpp @@ -28,8 +28,8 @@ Plant::Plant(const lisp::Lisp& reader) { reader.get("x", start_position.x); reader.get("y", start_position.y); - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/plant/plant.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); state = PLANT_SLEEPING; } diff --git a/src/badguy/poisonivy.cpp b/src/badguy/poisonivy.cpp index cad1a6402..9a30f6224 100644 --- a/src/badguy/poisonivy.cpp +++ b/src/badguy/poisonivy.cpp @@ -27,8 +27,8 @@ PoisonIvy::PoisonIvy(const lisp::Lisp& reader) { reader.get("x", start_position.x); reader.get("y", start_position.y); - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/poison_ivy/poison_ivy.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); set_direction = false; } @@ -36,8 +36,8 @@ PoisonIvy::PoisonIvy(float pos_x, float pos_y, Direction d) { start_position.x = pos_x; start_position.y = pos_y; - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/poison_ivy/poison_ivy.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); set_direction = true; initial_direction = d; } diff --git a/src/badguy/rocketexplosion.cpp b/src/badguy/rocketexplosion.cpp index 68d044c56..0d0adb73b 100644 --- a/src/badguy/rocketexplosion.cpp +++ b/src/badguy/rocketexplosion.cpp @@ -27,8 +27,8 @@ RocketExplosion::RocketExplosion(const Vector& pos, Direction dir) { start_position = pos; bbox.set_pos(pos); - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/mr_rocket/explosion.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); this->dir = dir; countMe = false; explode(); diff --git a/src/badguy/skullyhop.cpp b/src/badguy/skullyhop.cpp index 2679ee7f0..6dc1074da 100644 --- a/src/badguy/skullyhop.cpp +++ b/src/badguy/skullyhop.cpp @@ -33,8 +33,8 @@ SkullyHop::SkullyHop(const lisp::Lisp& reader) { reader.get("x", start_position.x); reader.get("y", start_position.y); - bbox.set_size(33.8, 43.8); //sprite is 34x44 sprite = sprite_manager->create("images/creatures/skullyhop/skullyhop.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); has_initial_direction = false; } @@ -42,8 +42,8 @@ SkullyHop::SkullyHop(float pos_x, float pos_y, Direction d) { start_position.x = pos_x; start_position.y = pos_y; - bbox.set_size(33.8, 43.8); //sprite is 34x44 sprite = sprite_manager->create("images/creatures/skullyhop/skullyhop.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); has_initial_direction = true; initial_direction = d; } diff --git a/src/badguy/snail.cpp b/src/badguy/snail.cpp index 565aa0f91..330846cf7 100644 --- a/src/badguy/snail.cpp +++ b/src/badguy/snail.cpp @@ -34,8 +34,8 @@ Snail::Snail(const lisp::Lisp& reader) { reader.get("x", start_position.x); reader.get("y", start_position.y); - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/snail/snail.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); set_direction = false; } @@ -44,8 +44,8 @@ Snail::Snail(float pos_x, float pos_y, Direction d) { start_position.x = pos_x; start_position.y = pos_y; - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/snail/snail.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); set_direction = true; initial_direction = d; } diff --git a/src/badguy/snowball.cpp b/src/badguy/snowball.cpp index 1c2e6b678..c562ab50b 100644 --- a/src/badguy/snowball.cpp +++ b/src/badguy/snowball.cpp @@ -30,9 +30,9 @@ SnowBall::SnowBall(const lisp::Lisp& reader) //This is for a hidden badguy :) fluffy = false; reader.get("fluffy",fluffy); - bbox.set_size(31.8, 31.8); if (fluffy) sprite = sprite_manager->create("images/creatures/fluffy/fluffy.sprite"); else sprite = sprite_manager->create("images/creatures/snowball/snowball.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); set_direction = false; } @@ -40,8 +40,8 @@ SnowBall::SnowBall(float pos_x, float pos_y, Direction d) { start_position.x = pos_x; start_position.y = pos_y; - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/snowball/snowball.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); set_direction = true; initial_direction = d; } diff --git a/src/badguy/spidermite.cpp b/src/badguy/spidermite.cpp index d8f697078..3b537b290 100644 --- a/src/badguy/spidermite.cpp +++ b/src/badguy/spidermite.cpp @@ -29,8 +29,8 @@ SpiderMite::SpiderMite(const lisp::Lisp& reader) { reader.get("x", start_position.x); reader.get("y", start_position.y); - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/spidermite/spidermite.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); physic.enable_gravity(false); } @@ -38,8 +38,8 @@ SpiderMite::SpiderMite(float pos_x, float pos_y) { start_position.x = pos_x; start_position.y = pos_y; - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/spidermite/spidermite.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); physic.enable_gravity(false); } diff --git a/src/badguy/spiky.cpp b/src/badguy/spiky.cpp index 8aceaae30..9118eea67 100644 --- a/src/badguy/spiky.cpp +++ b/src/badguy/spiky.cpp @@ -27,8 +27,8 @@ Spiky::Spiky(const lisp::Lisp& reader) { reader.get("x", start_position.x); reader.get("y", start_position.y); - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/spiky/spiky.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); } void diff --git a/src/badguy/sspiky.cpp b/src/badguy/sspiky.cpp index 8275b88fc..989fe2c80 100644 --- a/src/badguy/sspiky.cpp +++ b/src/badguy/sspiky.cpp @@ -28,8 +28,8 @@ SSpiky::SSpiky(const lisp::Lisp& reader) { reader.get("x", start_position.x); reader.get("y", start_position.y); - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/spiky/sleepingspiky.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); state = SSPIKY_SLEEPING; } diff --git a/src/badguy/stalactite.cpp b/src/badguy/stalactite.cpp index f2f7b7f88..0a9a145c8 100644 --- a/src/badguy/stalactite.cpp +++ b/src/badguy/stalactite.cpp @@ -30,8 +30,8 @@ Stalactite::Stalactite(const lisp::Lisp& lisp) { lisp.get("x", start_position.x); lisp.get("y", start_position.y); - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/stalactite/stalactite.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); state = STALACTITE_HANGING; countMe = false; } diff --git a/src/badguy/totem.cpp b/src/badguy/totem.cpp index 9a6b23049..88620f913 100644 --- a/src/badguy/totem.cpp +++ b/src/badguy/totem.cpp @@ -31,11 +31,11 @@ Totem::Totem(const lisp::Lisp& reader) { carrying = 0; carried_by = 0; - bbox.set_size(48, 49); reader.get("x", start_position.x); reader.get("y", start_position.y); sprite = sprite_manager->create("images/creatures/totem/totem.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); } Totem::~Totem() @@ -130,7 +130,8 @@ Totem::collision_squished(Player& player) } sprite->set_action(dir == LEFT ? "squished-left" : "squished-right"); - this->bbox.set_size(48, 45); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); + kill_squished(player); return true; } @@ -215,8 +216,8 @@ Totem::jump_on(Totem* target) target->carrying = this; this->carried_by = target; - this->bbox.set_size(48, 45); this->activate(); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); this->synchronize_with(target); } @@ -231,9 +232,10 @@ Totem::jump_off() { carried_by->carrying = 0; this->carried_by = 0; - this->bbox.set_size(48, 49); this->activate(); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); + physic.set_velocity_y(JUMP_OFF_SPEED_Y); } @@ -248,7 +250,7 @@ Totem::synchronize_with(Totem* base) } Vector pos = base->get_pos(); - pos.y -= 45; + pos.y -= sprite->get_current_hitbox_height(); set_pos(pos); physic.set_velocity_x(base->physic.get_velocity_x()); diff --git a/src/badguy/willowisp.cpp b/src/badguy/willowisp.cpp index bc15ac6f3..d9c6a63cb 100644 --- a/src/badguy/willowisp.cpp +++ b/src/badguy/willowisp.cpp @@ -35,8 +35,8 @@ WillOWisp::WillOWisp(const lisp::Lisp& reader) reader.get("sector", target_sector); reader.get("spawnpoint", target_spawnpoint); - bbox.set_size(32, 32); sprite = sprite_manager->create("images/creatures/willowisp/willowisp.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); countMe = false; layer = LAYER_FLOATINGOBJECTS; } diff --git a/src/badguy/yeti.cpp b/src/badguy/yeti.cpp index 9efb5cf9f..42dbe4155 100644 --- a/src/badguy/yeti.cpp +++ b/src/badguy/yeti.cpp @@ -56,8 +56,8 @@ Yeti::Yeti(const lisp::Lisp& reader) { reader.get("x", start_position.x); reader.get("y", start_position.y); - bbox.set_size(60, 90); sprite = sprite_manager->create("images/creatures/yeti/yeti.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); hit_points = INITIAL_HITPOINTS; reader.get("dead-script", dead_script); countMe = false; diff --git a/src/badguy/zeekling.cpp b/src/badguy/zeekling.cpp index 282d1aa0d..e264078f6 100644 --- a/src/badguy/zeekling.cpp +++ b/src/badguy/zeekling.cpp @@ -29,8 +29,8 @@ Zeekling::Zeekling(const lisp::Lisp& reader) { reader.get("x", start_position.x); reader.get("y", start_position.y); - bbox.set_size(31.8, 31.8); sprite = sprite_manager->create("images/creatures/zeekling/zeekling.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); set_direction = false; state = FLYING; } @@ -39,8 +39,8 @@ Zeekling::Zeekling(float pos_x, float pos_y, Direction d) { start_position.x = pos_x; start_position.y = pos_y; - bbox.set_size(63.8, 50.8); sprite = sprite_manager->create("images/creatures/zeekling/zeekling.sprite"); + bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); set_direction = true; initial_direction = d; state = FLYING; -- 2.11.0