projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6c2f40e
)
Renamed some variables for rusty_trampoline since the build process for Windows canno...
author
LMH
<lmh.0013@gmail.com>
Sun, 29 Dec 2013 02:55:15 +0000
(16:55 -1000)
committer
LMH
<lmh.0013@gmail.com>
Sun, 29 Dec 2013 02:55:15 +0000
(16:55 -1000)
src/object/rusty_trampoline.cpp
patch
|
blob
|
history
diff --git
a/src/object/rusty_trampoline.cpp
b/src/object/rusty_trampoline.cpp
index
120405f
..
002af24
100644
(file)
--- a/
src/object/rusty_trampoline.cpp
+++ b/
src/object/rusty_trampoline.cpp
@@
-25,19
+25,19
@@
#include "supertux/object_factory.hpp"
#include "util/reader.hpp"
#include "supertux/object_factory.hpp"
#include "util/reader.hpp"
-/* Trampoline will accelerate player to to VY_
INITIAL
, if
- * he jumps on it to VY_
MIN
. */
+/* Trampoline will accelerate player to to VY_
BOUNCE
, if
+ * he jumps on it to VY_
TRIGGER
. */
namespace {
namespace {
-const std::string
TRAMPOLIN
E_SOUND = "sounds/trampoline.wav";
-const float VY_
MIN
= -900; //negative, upwards
-const float VY_
INITIAL
= -500;
+const std::string
BOUNC
E_SOUND = "sounds/trampoline.wav";
+const float VY_
TRIGGER
= -900; //negative, upwards
+const float VY_
BOUNCE
= -500;
}
RustyTrampoline::RustyTrampoline(const Reader& lisp) :
Rock(lisp, "images/objects/rusty-trampoline/rusty-trampoline.sprite"),
portable(true), counter(3)
{
}
RustyTrampoline::RustyTrampoline(const Reader& lisp) :
Rock(lisp, "images/objects/rusty-trampoline/rusty-trampoline.sprite"),
portable(true), counter(3)
{
- sound_manager->preload(
TRAMPOLIN
E_SOUND);
+ sound_manager->preload(
BOUNC
E_SOUND);
lisp.get("counter", counter);
lisp.get("portable", portable); //do we really need this?
lisp.get("counter", counter);
lisp.get("portable", portable); //do we really need this?
@@
-71,12
+71,12
@@
RustyTrampoline::collision(GameObject& other, const CollisionHit& hit)
//player is falling down on trampoline
if(hit.top && vy >= 0) {
if(player->get_controller()->hold(Controller::JUMP)) {
//player is falling down on trampoline
if(hit.top && vy >= 0) {
if(player->get_controller()->hold(Controller::JUMP)) {
- vy = VY_
MIN
;
+ vy = VY_
TRIGGER
;
} else {
} else {
- vy = VY_
INITIAL
;
+ vy = VY_
BOUNCE
;
}
player->get_physic().set_velocity_y(vy);
}
player->get_physic().set_velocity_y(vy);
- sound_manager->play(
TRAMPOLIN
E_SOUND);
+ sound_manager->play(
BOUNC
E_SOUND);
counter--;
if (counter > 0) {
sprite->set_action("swinging", 1);
counter--;
if (counter > 0) {
sprite->set_action("swinging", 1);
@@
-93,9
+93,9
@@
RustyTrampoline::collision(GameObject& other, const CollisionHit& hit)
float vy = walking_badguy->get_velocity_y();
//walking_badguy is falling down on trampoline
if(hit.top && vy >= 0) {
float vy = walking_badguy->get_velocity_y();
//walking_badguy is falling down on trampoline
if(hit.top && vy >= 0) {
- vy = VY_
INITIAL
;
+ vy = VY_
BOUNCE
;
walking_badguy->set_velocity_y(vy);
walking_badguy->set_velocity_y(vy);
- sound_manager->play(
TRAMPOLIN
E_SOUND);
+ sound_manager->play(
BOUNC
E_SOUND);
counter--;
if (counter > 0) {
sprite->set_action("swinging", 1);
counter--;
if (counter > 0) {
sprite->set_action("swinging", 1);