projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some more aspect ratio stuff
[supertux.git]
/
src
/
badguy
/
mriceblock.cpp
diff --git
a/src/badguy/mriceblock.cpp
b/src/badguy/mriceblock.cpp
index
cb801b3
..
7ab2837
100644
(file)
--- a/
src/badguy/mriceblock.cpp
+++ b/
src/badguy/mriceblock.cpp
@@
-25,6
+25,7
@@
namespace {
const float KICKSPEED = 500;
const int MAXSQUISHES = 10;
namespace {
const float KICKSPEED = 500;
const int MAXSQUISHES = 10;
+ const float NOKICK_TIME = 0.1f;
}
MrIceBlock::MrIceBlock(const lisp::Lisp& reader)
}
MrIceBlock::MrIceBlock(const lisp::Lisp& reader)
@@
-56,9
+57,9
@@
MrIceBlock::write(lisp::Writer& writer)
}
void
}
void
-MrIceBlock::
activat
e()
+MrIceBlock::
initializ
e()
{
{
- WalkingBadguy::
activat
e();
+ WalkingBadguy::
initializ
e();
set_state(ICESTATE_NORMAL);
}
set_state(ICESTATE_NORMAL);
}
@@
-183,13
+184,17
@@
MrIceBlock::collision_squished(GameObject& object)
switch(ice_state) {
case ICESTATE_KICKED:
case ICESTATE_NORMAL:
switch(ice_state) {
case ICESTATE_KICKED:
case ICESTATE_NORMAL:
- squishcount++;
- if(squishcount >= MAXSQUISHES) {
- kill_fall();
- return true;
+ {
+ Player* player = dynamic_cast<Player*>(&object);
+ squishcount++;
+ if ((squishcount >= MAXSQUISHES) || (player && player->does_buttjump)) {
+ kill_fall();
+ return true;
+ }
}
set_state(ICESTATE_FLAT);
}
set_state(ICESTATE_FLAT);
+ nokick_timer.start(NOKICK_TIME);
break;
case ICESTATE_FLAT:
{
break;
case ICESTATE_FLAT:
{
@@
-200,7
+205,7
@@
MrIceBlock::collision_squished(GameObject& object)
dir = LEFT;
}
}
dir = LEFT;
}
}
- set_state(ICESTATE_KICKED);
+
if (nokick_timer.check())
set_state(ICESTATE_KICKED);
break;
case ICESTATE_GRABBED:
assert(false);
break;
case ICESTATE_GRABBED:
assert(false);
@@
-220,7
+225,7
@@
MrIceBlock::set_state(IceState state)
switch(state) {
case ICESTATE_NORMAL:
switch(state) {
case ICESTATE_NORMAL:
- WalkingBadguy::
activat
e();
+ WalkingBadguy::
initializ
e();
break;
case ICESTATE_FLAT:
if(dir == UP) {
break;
case ICESTATE_FLAT:
if(dir == UP) {
@@
-259,7
+264,7
@@
MrIceBlock::grab(MovingObject&, const Vector& pos, Direction dir)
this->dir = dir;
sprite->set_action(dir == LEFT ? "flat-left" : "flat-right");
set_state(ICESTATE_GRABBED);
this->dir = dir;
sprite->set_action(dir == LEFT ? "flat-left" : "flat-right");
set_state(ICESTATE_GRABBED);
- set_
group
(COLGROUP_DISABLED);
+ set_
colgroup_active
(COLGROUP_DISABLED);
}
void
}
void
@@
-267,7
+272,7
@@
MrIceBlock::ungrab(MovingObject& , Direction dir)
{
this->dir = dir;
set_state(dir == UP ? ICESTATE_FLAT : ICESTATE_KICKED);
{
this->dir = dir;
set_state(dir == UP ? ICESTATE_FLAT : ICESTATE_KICKED);
- set_
group
(COLGROUP_MOVING);
+ set_
colgroup_active
(COLGROUP_MOVING);
}
bool
}
bool