projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Russian translation update from Constantin Baranov... from December.
[supertux.git]
/
src
/
badguy
/
kugelblitz.cpp
diff --git
a/src/badguy/kugelblitz.cpp
b/src/badguy/kugelblitz.cpp
index
558c562
..
813492d
100644
(file)
--- a/
src/badguy/kugelblitz.cpp
+++ b/
src/badguy/kugelblitz.cpp
@@
-34,12
+34,9
@@
static const float X_OFFSCREEN_DISTANCE = 1600;
static const float Y_OFFSCREEN_DISTANCE = 1200;
Kugelblitz::Kugelblitz(const lisp::Lisp& reader)
static const float Y_OFFSCREEN_DISTANCE = 1200;
Kugelblitz::Kugelblitz(const lisp::Lisp& reader)
- : groundhit_pos_set(false)
+ :
BadGuy(reader, "images/creatures/kugelblitz/kugelblitz.sprite"),
groundhit_pos_set(false)
{
reader.get("x", start_position.x);
{
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");
physic.enable_gravity(false);
}
sprite->set_action("falling");
physic.enable_gravity(false);
}
@@
-55,18
+52,18
@@
Kugelblitz::write(lisp::Writer& writer)
}
void
}
void
-Kugelblitz::
activat
e()
+Kugelblitz::
initializ
e()
{
{
- physic.set_velocity_y(
-
300);
+ physic.set_velocity_y(300);
physic.set_velocity_x(-20); //fall a little to the left
direction = 1;
dying = false;
}
physic.set_velocity_x(-20); //fall a little to the left
direction = 1;
dying = false;
}
-HitResponse
-Kugelblitz::collision_solid(
GameObject& ,
const CollisionHit& chit)
+void
+Kugelblitz::collision_solid(const CollisionHit& chit)
{
{
-
return
hit(chit);
+ hit(chit);
}
HitResponse
}
HitResponse
@@
-100,10
+97,10
@@
Kugelblitz::collision_badguy(BadGuy& other , const CollisionHit& chit)
}
HitResponse
}
HitResponse
-Kugelblitz::hit(const CollisionHit&
c
hit)
+Kugelblitz::hit(const CollisionHit& hit)
{
// hit floor?
{
// hit floor?
- if(
chit.normal.y < -.5
) {
+ if(
hit.bottom
) {
if (!groundhit_pos_set)
{
pos_groundhit = get_pos();
if (!groundhit_pos_set)
{
pos_groundhit = get_pos();
@@
-118,7
+115,7
@@
Kugelblitz::hit(const CollisionHit& chit)
movement_timer.start(MOVETIME);
lifetime.start(LIFETIME);
movement_timer.start(MOVETIME);
lifetime.start(LIFETIME);
- } else if(
chit.normal.y < .5
) { // bumped on roof
+ } else if(
hit.top
) { // bumped on roof
physic.set_velocity_y(0);
}
physic.set_velocity_y(0);
}
@@
-140,6
+137,7
@@
Kugelblitz::active_update(float elapsed_time)
movement_timer.start(MOVETIME);
}
}
movement_timer.start(MOVETIME);
}
}
+ /*
if (Sector::current()->solids->get_tile_at(get_pos())->getAttributes() == 16) {
//HIT WATER
Sector::current()->add_object(new Electrifier(75,1421,1.5));
if (Sector::current()->solids->get_tile_at(get_pos())->getAttributes() == 16) {
//HIT WATER
Sector::current()->add_object(new Electrifier(75,1421,1.5));
@@
-150,8
+148,9
@@
Kugelblitz::active_update(float elapsed_time)
//HIT ELECTRIFIED WATER
explode();
}
//HIT ELECTRIFIED WATER
explode();
}
+ */
}
}
- BadGuy::active_update(elapsed_time);
+ BadGuy::active_update(elapsed_time);
}
void
}
void
@@
-164,7
+163,7
@@
Kugelblitz::explode()
{
if (!dying) {
sprite->set_action("pop");
{
if (!dying) {
sprite->set_action("pop");
- lifetime.start(0.2);
+ lifetime.start(0.2
f
);
dying = true;
}
else remove_me();
dying = true;
}
else remove_me();