projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed MrTree. He uses activate() to change direction which is now working again.
[supertux.git]
/
src
/
badguy
/
nolok_01.cpp
diff --git
a/src/badguy/nolok_01.cpp
b/src/badguy/nolok_01.cpp
index
255cee5
..
b1e7c77
100644
(file)
--- a/
src/badguy/nolok_01.cpp
+++ b/
src/badguy/nolok_01.cpp
@@
-1,7
+1,7
@@
// $Id$
// $Id$
-//
+//
// SuperTux
// SuperTux
-// Copyright (C) 200
5
Matthias Braun <matze@braunis.de>
+// Copyright (C) 200
6
Matthias Braun <matze@braunis.de>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
@@
-12,17
+12,16
@@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
-//
+//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA.
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <config.h>
#include <config.h>
-#include "nolok_01.h"
-#include "badguy/
bouncing_snowball.h
"
-#include "trigger/door.h"
+#include "nolok_01.h
pp
"
+#include "badguy/
snail.hpp
"
+#include "trigger/door.h
pp
"
#define WALK_TIME 2.5
#define SHOOT_TIME 0.4
#define WALK_TIME 2.5
#define SHOOT_TIME 0.4
@@
-34,20
+33,14
@@
static const float WALKSPEED = 90;
//TODO: Create sprite, limit max number of snowballs
Nolok_01::Nolok_01(const lisp::Lisp& reader)
//TODO: Create sprite, limit max number of snowballs
Nolok_01::Nolok_01(const lisp::Lisp& reader)
+ : BadGuy(reader, "images/creatures/nolok/nolok.sprite")
{
{
- reader.get("x", start_position.x);
- reader.get("y", start_position.y);
- bbox.set_size(31.8, 63.8);
- sprite = sprite_manager->create("dummyguy");
countMe = false;
}
countMe = false;
}
-Nolok_01::Nolok_01(float pos_x, float pos_y)
+Nolok_01::Nolok_01(const Vector& pos)
+ : BadGuy(pos, "images/creatures/nolok/nolok.sprite")
{
{
- start_position.x = pos_x;
- start_position.y = pos_y;
- bbox.set_size(31.8, 63.8);
- sprite = sprite_manager->create("dummyguy");
countMe = false;
}
countMe = false;
}
@@
-81,7
+74,7
@@
Nolok_01::active_update(float elapsed_time)
case WALKING:
{
sprite->set_action("jump");
case WALKING:
{
sprite->set_action("jump");
- physic.set_velocity_y(700);
+ physic.set_velocity_y(
-
700);
action = JUMPING;
action_timer.start(JUMP_TIME);
break;
action = JUMPING;
action_timer.start(JUMP_TIME);
break;
@@
-95,8
+88,8
@@
Nolok_01::active_update(float elapsed_time)
}
case SHOOTING:
{
}
case SHOOTING:
{
- Sector::current()->add_object(new
BouncingSnowball(get_pos().x - 64, get_pos().y
, LEFT));
- Sector::current()->add_object(new
BouncingSnowball(get_pos().x + 64, get_pos().y
, RIGHT));
+ Sector::current()->add_object(new
Snail(Vector(get_pos().x - 64, get_pos().y)
, LEFT));
+ Sector::current()->add_object(new
Snail(Vector(get_pos().x + 64, get_pos().y)
, RIGHT));
physic.set_velocity_x(dir == LEFT ? -WALKSPEED : WALKSPEED);
sprite->set_action(dir == LEFT ? "left" : "right");
action = WALKING;
physic.set_velocity_x(dir == LEFT ? -WALKSPEED : WALKSPEED);
sprite->set_action(dir == LEFT ? "left" : "right");
action = WALKING;
@@
-147,8
+140,8
@@
Nolok_01::kill_fall()
bullet_hitpoints--;
if (bullet_hitpoints <= 0) {
hitpoints = 0;
bullet_hitpoints--;
if (bullet_hitpoints <= 0) {
hitpoints = 0;
- sound_manager->play
_sound("fall
", this,
-
Sector::current()->player
->get_pos());
+ sound_manager->play
("sounds/fall.wav
", this,
+
this
->get_pos());
physic.set_velocity_y(0);
physic.enable_gravity(true);
set_state(STATE_FALLING);
physic.set_velocity_y(0);
physic.enable_gravity(true);
set_state(STATE_FALLING);