Skip to content

Commit 5495603

Browse files
committed
re-disable gravity for scrystallo, fix missing sprite actions
1 parent 746ed7d commit 5495603

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

data/images/creatures/crystallo/crystallo.sprite

+19
Original file line numberDiff line numberDiff line change
@@ -157,4 +157,23 @@
157157
(loops 1)
158158
(mirror-action "waking-left")
159159
)
160+
(action
161+
(name "jumping-left")
162+
(fps 14)
163+
(hitbox 10 12 32 26)
164+
(loops 1)
165+
(images "jump-0.png"
166+
"jump-1.png"
167+
"jump-2.png"
168+
"jump-3.png"
169+
"jump-4.png"
170+
"jump-5.png")
171+
)
172+
(action
173+
(name "jumping-right")
174+
(fps 14)
175+
(hitbox 8 12 32 26)
176+
(loops 1)
177+
(mirror-action "jumping-left")
178+
)
160179
)

src/badguy/rcrystallo.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ RCrystallo::RCrystallo(const Vector& pos, const Vector& start_pos, float vel_x,
4444
{
4545
if (fall) m_state = RCRYSTALLO_DETECT;
4646
m_physic.set_velocity_x(vel_x);
47-
m_physic.set_gravity_modifier(-1.f);
47+
m_physic.set_gravity_modifier(0.f);
4848
m_sprite = std::move(sprite);
4949
m_dead_script = script;
5050
m_start_position = start_pos;

src/badguy/scrystallo.cpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,8 @@ SCrystallo::SCrystallo(const ReaderMapping& reader) :
4343
void
4444
SCrystallo::initialize()
4545
{
46-
if (m_roof)
47-
{
48-
m_physic.set_gravity_modifier(-1.f);
49-
FlipLevelTransformer::transform_flip(m_flip);
50-
}
46+
m_physic.enable_gravity(false);
47+
if (m_roof) FlipLevelTransformer::transform_flip(m_flip);
5148
m_state = SCRYSTALLO_SLEEPING;
5249
set_action("sleeping", m_dir);
5350
}
@@ -127,6 +124,7 @@ SCrystallo::active_update(float dt_sec)
127124
return;
128125
}
129126

127+
m_physic.enable_gravity(true);
130128
m_physic.set_velocity_y(-250.f);
131129
WalkingBadguy::initialize();
132130
set_action(m_dir == Direction::LEFT ? "jumping-left" : "jumping-right", -1);
@@ -193,7 +191,6 @@ SCrystallo::on_flip(float height)
193191

194192
if (m_state == SCRYSTALLO_SLEEPING || m_state == SCRYSTALLO_WAKING)
195193
{
196-
m_physic.set_gravity_modifier(-m_physic.get_gravity_modifier());
197194
FlipLevelTransformer::transform_flip(m_flip);
198195
}
199196
else

0 commit comments

Comments
 (0)