projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
782a5ba
)
- reduced jump tolleranze to two tiles
author
Ingo Ruhnke
<grumbel@gmx.de>
Fri, 30 Apr 2004 09:48:34 +0000
(09:48 +0000)
committer
Ingo Ruhnke
<grumbel@gmx.de>
Fri, 30 Apr 2004 09:48:34 +0000
(09:48 +0000)
SVN-Revision: 860
src/player.cpp
patch
|
blob
|
history
src/player.h
patch
|
blob
|
history
diff --git
a/src/player.cpp
b/src/player.cpp
index
4ff4db4
..
785860b
100644
(file)
--- a/
src/player.cpp
+++ b/
src/player.cpp
@@
-18,7
+18,6
@@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <math.h>
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <math.h>
-
#include "gameloop.h"
#include "globals.h"
#include "player.h"
#include "gameloop.h"
#include "globals.h"
#include "player.h"
@@
-57,6
+56,7
@@
void player_input_init(player_input_type* pplayer_input)
pplayer_input->old_fire = UP;
pplayer_input->right = UP;
pplayer_input->up = UP;
pplayer_input->old_fire = UP;
pplayer_input->right = UP;
pplayer_input->up = UP;
+ pplayer_input->old_up = UP;
}
void
}
void
@@
-396,11
+396,23
@@
Player::handle_vertical_input()
else if(input.up == UP && jumping)
{
jumping = false;
else if(input.up == UP && jumping)
{
jumping = false;
- can_jump = true;
if(physic.get_velocity_y() > 0) {
physic.set_velocity_y(0);
}
}
if(physic.get_velocity_y() > 0) {
physic.set_velocity_y(0);
}
}
+
+ if ( (issolid(base.x + base.width / 2, base.y + base.height + 64) ||
+ issolid(base.x + 1, base.y + base.height + 64) ||
+ issolid(base.x + base.width - 1, base.y + base.height + 64))
+ && jumping == false
+ && can_jump == false
+ && input.up == DOWN
+ && input.old_up == UP)
+ {
+ can_jump = true;
+ }
+
+ input.old_up = input.up;
}
void
}
void
diff --git
a/src/player.h
b/src/player.h
index
c734ff7
..
3b0eabc
100644
(file)
--- a/
src/player.h
+++ b/
src/player.h
@@
-66,6
+66,7
@@
struct player_input_type
int right;
int left;
int up;
int right;
int left;
int up;
+ int old_up;
int down;
int fire;
int old_fire;
int down;
int fire;
int old_fire;