Commit e34e2bf4 authored by alistert's avatar alistert

Created LevelPlayerEvent enum. Added basic support for JJ2 springs.

parent 1fe1fc7e
...@@ -56,3 +56,32 @@ JJ2Event::~JJ2Event () { ...@@ -56,3 +56,32 @@ JJ2Event::~JJ2Event () {
} }
void JJ2Event::destroy (unsigned int ticks) {
time = ticks + 1000;
return;
}
unsigned char JJ2Event::getType () {
return type;
}
JJ2Event* JJ2Event::remove () {
JJ2Event *oldNext;
oldNext = next;
next = NULL;
delete this;
return oldNext;
}
...@@ -41,12 +41,17 @@ class JJ2Event : public Movable { ...@@ -41,12 +41,17 @@ class JJ2Event : public Movable {
unsigned char frame; unsigned char frame;
unsigned int flashTime; unsigned int flashTime;
JJ2Event* remove ();
void destroy (unsigned int ticks);
public: public:
JJ2Event (JJ2Event* newNext, unsigned char gridX, unsigned char gridY, unsigned char* properties); JJ2Event (JJ2Event* newNext, unsigned char gridX, unsigned char gridY, unsigned char* properties);
~JJ2Event (); ~JJ2Event ();
JJ2Event* step (int msps); unsigned char getType ();
void draw (int change);
JJ2Event* step (int ticks, int msps);
void draw (int change);
}; };
......
...@@ -26,13 +26,57 @@ ...@@ -26,13 +26,57 @@
#include "jj2event.h" #include "jj2event.h"
#include "../jj2level.h"
#include "io/gfx/anim.h"
#include "io/gfx/video.h" #include "io/gfx/video.h"
#include "player/jj2levelplayer.h"
JJ2Event* JJ2Event::step (int msps) { JJ2Event* JJ2Event::step (int ticks, int msps) {
JJ2LevelPlayer *levelPlayer;
int count;
if (next) next = next->step(ticks, msps);
// Handle behaviour
switch (type) {
case 85: // Red spring
case 86: // Green spring
case 87: // Blue spring
if (!jj2Level->checkMaskDown(x, y + F8)) y += F8;
break;
default:
break;
}
// Handle contact with player
for (count = 0; count < nPlayers; count++) {
levelPlayer = players[count].getJJ2LevelPlayer();
// Check if the player is touching the event
if (levelPlayer->overlap(x, y, F32, F32)) {
// If the player picks up the event, destroy it
if (levelPlayer->touchEvent(this, ticks, msps))
destroy(ticks);
}
}
if (next) next = next->step(msps);
return this; return this;
...@@ -41,14 +85,47 @@ JJ2Event* JJ2Event::step (int msps) { ...@@ -41,14 +85,47 @@ JJ2Event* JJ2Event::step (int msps) {
void JJ2Event::draw (int change) { void JJ2Event::draw (int change) {
Anim* an;
int drawX, drawY; int drawX, drawY;
if (next) next->draw(change); if (next) next->draw(change);
// Don't draw if too far off-screen
if ((x < viewX - F64) || (y < viewY - F64) ||
(x > viewX + ITOF(viewW) + F64) || (y > viewY + ITOF(viewH) + F64)) return;
drawX = getDrawX(change); drawX = getDrawX(change);
drawY = getDrawY(change); drawY = getDrawY(change);
if (type > 2) drawRect(FTOI(drawX) + 8, FTOI(drawY) + 8, 16, 16, type); switch (type) {
case 85: // Red spring
an = jj2Level->getAnim(32);
break;
case 86: // Green spring
an = jj2Level->getAnim(35);
break;
case 87: // Blue spring
an = jj2Level->getAnim(37);
break;
default:
drawRect(FTOI(drawX) + 8, FTOI(drawY) + 8, 16, 16, type);
return;
}
an->draw(drawX, drawY);
return; return;
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
*/ */
#include "jj2event/jj2event.h"
#include "jj2level.h" #include "jj2level.h"
#include "game/game.h" #include "game/game.h"
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
int JJ2Level::step () { int JJ2Level::step () {
int x, y; int x;
int msps; int msps;
...@@ -54,7 +54,7 @@ int JJ2Level::step () { ...@@ -54,7 +54,7 @@ int JJ2Level::step () {
// Process events // Process events
if (events) events = events->step(msps); if (events) events = events->step(ticks, msps);
// Apply as much of those trajectories as possible, without going into the // Apply as much of those trajectories as possible, without going into the
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "game/game.h" #include "game/game.h"
#include "game/gamemode.h" #include "game/gamemode.h"
#include "io/sound.h" #include "io/sound.h"
#include "jj2level/jj2event/jj2event.h"
#include "jj2level/jj2level.h" #include "jj2level/jj2level.h"
#include <string.h> #include <string.h>
...@@ -127,6 +128,7 @@ JJ2LevelPlayer::~JJ2LevelPlayer () { ...@@ -127,6 +128,7 @@ JJ2LevelPlayer::~JJ2LevelPlayer () {
void JJ2LevelPlayer::reset (unsigned char startX, unsigned char startY) { void JJ2LevelPlayer::reset (unsigned char startX, unsigned char startY) {
event = NULL;
energy = 5; energy = 5;
floating = false; floating = false;
facing = true; facing = true;
...@@ -304,14 +306,43 @@ void JJ2LevelPlayer::setSpeed (fixed newDx, fixed newDy) { ...@@ -304,14 +306,43 @@ void JJ2LevelPlayer::setSpeed (fixed newDx, fixed newDy) {
} }
bool JJ2LevelPlayer::takeEvent (unsigned char gridX, unsigned char gridY, unsigned int ticks) { bool JJ2LevelPlayer::takeEvent (JJ2Event* event, unsigned int ticks) {
return true; return true;
} }
bool JJ2LevelPlayer::touchEvent (unsigned char gridX, unsigned char gridY, unsigned int ticks, int msps) { bool JJ2LevelPlayer::touchEvent (JJ2Event* touched, unsigned int ticks, int msps) {
switch (touched->getType()) {
case 85: // Red spring
jumpY = y - TTOF(6);
event = touched;
break;
case 86: // Green spring
jumpY = y - TTOF(12);
event = touched;
break;
case 87: // Blue spring
jumpY = y - TTOF(18);
event = touched;
break;
default:
break;
}
return false; return false;
......
...@@ -166,11 +166,13 @@ enum JJ2Shield { ...@@ -166,11 +166,13 @@ enum JJ2Shield {
// Classes // Classes
class Anim; class Anim;
class JJ2Event;
class JJ2LevelPlayer : public Movable { class JJ2LevelPlayer : public Movable {
private: private:
bool bird; // Placeholder for eventual JJ2Bird object bool bird; // Placeholder for eventual JJ2Bird object
JJ2Event* event;
SDL_Color palette[256]; SDL_Color palette[256];
char anims[PANIMS]; char anims[PANIMS];
int energy; int energy;
...@@ -210,8 +212,8 @@ class JJ2LevelPlayer : public Movable { ...@@ -210,8 +212,8 @@ class JJ2LevelPlayer : public Movable {
JJ2PlayerReaction reacted (unsigned int ticks); JJ2PlayerReaction reacted (unsigned int ticks);
void setPosition (fixed newX, fixed newY); void setPosition (fixed newX, fixed newY);
void setSpeed (fixed newDx, fixed newDy); void setSpeed (fixed newDx, fixed newDy);
bool takeEvent (unsigned char gridX, unsigned char gridY, unsigned int ticks); bool takeEvent (JJ2Event* event, unsigned int ticks);
bool touchEvent (unsigned char gridX, unsigned char gridY, unsigned int ticks, int msps); bool touchEvent (JJ2Event* touched, unsigned int ticks, int msps);
void send (unsigned char* buffer); void send (unsigned char* buffer);
void receive (unsigned char* buffer); void receive (unsigned char* buffer);
......
...@@ -33,13 +33,18 @@ ...@@ -33,13 +33,18 @@
#include "io/gfx/font.h" #include "io/gfx/font.h"
#include "io/gfx/video.h" #include "io/gfx/video.h"
#include "io/sound.h" #include "io/sound.h"
#include "jj2level/jj2event/jj2event.h"
#include "jj2level/jj2level.h" #include "jj2level/jj2level.h"
#include "util.h" #include "util.h"
void JJ2LevelPlayer::control (unsigned int ticks, int msps) { void JJ2LevelPlayer::control (unsigned int ticks, int msps) {
bool platform; bool platform;
unsigned char type;
if (event) type = event->getType();
else type = 0;
// Respond to controls, unless the player has been killed // Respond to controls, unless the player has been killed
...@@ -153,12 +158,13 @@ void JJ2LevelPlayer::control (unsigned int ticks, int msps) { ...@@ -153,12 +158,13 @@ void JJ2LevelPlayer::control (unsigned int ticks, int msps) {
} }
/*if (event) { if (type) {
if (event == 1) dy = jj2Level->getEvent(eventX, eventY)[E_MULTIPURPOSE] * -F20; if (type == 85) dy = PYS_JUMP;
else if (event == 2) dy = PYS_JUMP; else if (type == 86) dy = PYS_JUMP;
else if (type == 87) dy = PYS_JUMP;
}*/ }
if (dy < -PXS_RUN) dy = -PXS_RUN; if (dy < -PXS_RUN) dy = -PXS_RUN;
if (dy > PXS_RUN) dy = PXS_RUN; if (dy > PXS_RUN) dy = PXS_RUN;
...@@ -182,7 +188,7 @@ void JJ2LevelPlayer::control (unsigned int ticks, int msps) { ...@@ -182,7 +188,7 @@ void JJ2LevelPlayer::control (unsigned int ticks, int msps) {
if (dx < 0) jumpY += dx >> 4; if (dx < 0) jumpY += dx >> 4;
else if (dx > 0) jumpY -= dx >> 4; else if (dx > 0) jumpY -= dx >> 4;
//event = 0; event = NULL;
} }
...@@ -219,14 +225,14 @@ void JJ2LevelPlayer::control (unsigned int ticks, int msps) { ...@@ -219,14 +225,14 @@ void JJ2LevelPlayer::control (unsigned int ticks, int msps) {
if (dx < 0) jumpY += dx >> 3; if (dx < 0) jumpY += dx >> 3;
else if (dx > 0) jumpY -= dx >> 3; else if (dx > 0) jumpY -= dx >> 3;
//event = 0; event = NULL;
playSound(S_JUMPA); playSound(S_JUMPA);
} }
// Stop jumping // Stop jumping
if (!player->pcontrols[C_JUMP] /*&& (event != 1) && (event != 2)*/) if (!player->pcontrols[C_JUMP] && (type != 85) && (type != 86) && (type != 87))
jumpY = TTOF(256); jumpY = TTOF(256);
if (y >= jumpY) { if (y >= jumpY) {
...@@ -235,19 +241,15 @@ void JJ2LevelPlayer::control (unsigned int ticks, int msps) { ...@@ -235,19 +241,15 @@ void JJ2LevelPlayer::control (unsigned int ticks, int msps) {
dy = (jumpY - y - F64) * 4; dy = (jumpY - y - F64) * 4;
// Spring/float up speed limit // Spring up speed limit
/*if ((event == 1) || (event == 2)) { if ((type == 85) || (type == 86) || (type == 87)) {
speed = jj2Level->getEvent(eventX, eventY)[E_MULTIPURPOSE] * -F20;
if (speed >= 0) speed = PYS_JUMP; if (dy < PYS_JUMP) dy = PYS_JUMP;
if (dy < speed) dy = speed; }
}*/
// Avoid jumping too fast, unless caused by an event // Avoid jumping too fast, unless caused by an event
if (/* !event &&*/ (dy < PYS_JUMP)) dy = PYS_JUMP; if (!event && (dy < PYS_JUMP)) dy = PYS_JUMP;
} else if (!platform) { } else if (!platform) {
...@@ -282,7 +284,7 @@ void JJ2LevelPlayer::control (unsigned int ticks, int msps) { ...@@ -282,7 +284,7 @@ void JJ2LevelPlayer::control (unsigned int ticks, int msps) {
jumpY = TTOF(256); jumpY = TTOF(256);
if (dy < 0) dy = 0; if (dy < 0) dy = 0;
//if ((event != 3) && (event != 4)) event = 0; /*if ((event != 3) && (event != 4))*/ event = NULL;
} }
...@@ -291,7 +293,7 @@ void JJ2LevelPlayer::control (unsigned int ticks, int msps) { ...@@ -291,7 +293,7 @@ void JJ2LevelPlayer::control (unsigned int ticks, int msps) {
jumpY = TTOF(256); jumpY = TTOF(256);
//if ((event != 3) && (event != 4)) event = 0; /*if ((event != 3) && (event != 4))*/ event = NULL;
} }
...@@ -362,8 +364,8 @@ void JJ2LevelPlayer::control (unsigned int ticks, int msps) { ...@@ -362,8 +364,8 @@ void JJ2LevelPlayer::control (unsigned int ticks, int msps) {
else if (dy < 0) { else if (dy < 0) {
/*if (event == 1) animType = facing? PA_RSPRING: PA_LSPRING; if ((type == 85) || (type == 86) || (type == 87)) animType = facing? PA_RSPRING: PA_LSPRING;
else*/ animType = facing? PA_RJUMP: PA_LJUMP; else animType = facing? PA_RJUMP: PA_LJUMP;
} else if (platform) { } else if (platform) {
......
...@@ -124,7 +124,7 @@ LevelPlayer::~LevelPlayer () { ...@@ -124,7 +124,7 @@ LevelPlayer::~LevelPlayer () {
void LevelPlayer::reset (unsigned char startX, unsigned char startY) { void LevelPlayer::reset (unsigned char startX, unsigned char startY) {
event = 0; event = LPE_NONE;
energy = 4; energy = 4;
floating = false; floating = false;
facing = true; facing = true;
...@@ -158,7 +158,7 @@ void LevelPlayer::clearEvent (unsigned char gridX, unsigned char gridY) { ...@@ -158,7 +158,7 @@ void LevelPlayer::clearEvent (unsigned char gridX, unsigned char gridY) {
// If the location matches, clear the event // If the location matches, clear the event
if ((gridX == eventX) && (gridY == eventY)) event = 0; if ((gridX == eventX) && (gridY == eventY)) event = LPE_NONE;
return; return;
...@@ -320,10 +320,10 @@ void LevelPlayer::setEvent (unsigned char gridX, unsigned char gridY) { ...@@ -320,10 +320,10 @@ void LevelPlayer::setEvent (unsigned char gridX, unsigned char gridY) {
// Upwards spring // Upwards spring
jumpY = y + (set[E_MAGNITUDE] * (F20 + F1)); jumpY = y + (set[E_MAGNITUDE] * (F20 + F1));
event = 1; event = LPE_SPRING;
} else if (set[E_MODIFIER] == 6) event = 3; } else if (set[E_MODIFIER] == 6) event = LPE_PLATFORM;
else if (set[E_BEHAVIOUR] == 28) event = 4; else if (set[E_BEHAVIOUR] == 28) event = LPE_BRIDGE;
else return; else return;
eventX = gridX; eventX = gridX;
...@@ -607,7 +607,7 @@ bool LevelPlayer::touchEvent (unsigned char gridX, unsigned char gridY, unsigned ...@@ -607,7 +607,7 @@ bool LevelPlayer::touchEvent (unsigned char gridX, unsigned char gridY, unsigned
eventX = gridX; eventX = gridX;
eventY = gridY; eventY = gridY;
event = 2; event = LPE_FLOAT;
if (dy > set[E_MULTIPURPOSE] * -F20) if (dy > set[E_MULTIPURPOSE] * -F20)
dy -= set[E_MULTIPURPOSE] * 320 * msps; dy -= set[E_MULTIPURPOSE] * 320 * msps;
......
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
#define PYA_SINK 1000 #define PYA_SINK 1000
// Enum // Enums
enum PlayerReaction { enum PlayerReaction {
...@@ -141,6 +141,12 @@ enum PlayerReaction { ...@@ -141,6 +141,12 @@ enum PlayerReaction {
}; };
enum LevelPlayerEvent {
LPE_NONE, LPE_SPRING, LPE_FLOAT, LPE_PLATFORM, LPE_BRIDGE
};
// Classes // Classes
...@@ -150,28 +156,28 @@ class Bird; ...@@ -150,28 +156,28 @@ class Bird;
class LevelPlayer : public Movable { class LevelPlayer : public Movable {
private: private:
Bird* bird; Bird* bird;
SDL_Color palette[256]; SDL_Color palette[256];
char anims[PANIMS]; char anims[PANIMS];
int energy; int energy;
int shield; /* 0 = none, 1 = 1 yellow, 2 = 2 yellow, 3 = 1 orange, 4 = 2 orange, 5 = 3 orange, 6 = 4 orange */ int shield; /* 0 = none, 1 = 1 yellow, 2 = 2 yellow, 3 = 1 orange, 4 = 2 orange, 5 = 3 orange, 6 = 4 orange */
bool floating; /* false = normal, true = boarding/bird/etc. */ bool floating; /* false = normal, true = boarding/bird/etc. */
bool facing; bool facing;
unsigned char animType; unsigned char animType;
unsigned char eventX; unsigned char eventX;
unsigned char eventY; /* Position of an event (spring, platform, bridge) */ unsigned char eventY; /* Position of an event (spring, platform, bridge) */
int event; /* 0 = none, 1 = spring, 2 = float up, 3 = platform, 4 = bridge */ LevelPlayerEvent event;
int lookTime; /* Negative if looking up, positive if looking down, 0 if neither */ int lookTime; /* Negative if looking up, positive if looking down, 0 if neither */
PlayerReaction reaction; PlayerReaction reaction;
unsigned int reactionTime; unsigned int reactionTime;
unsigned int fireTime; unsigned int fireTime;
fixed jumpHeight; fixed jumpHeight;
fixed jumpY; fixed jumpY;
unsigned int fastFeetTime; unsigned int fastFeetTime;
unsigned char warpX, warpY; unsigned char warpX, warpY;
unsigned int warpTime; unsigned int warpTime;
int enemies, items; int enemies, items;
bool gem; bool gem;
public: public:
Player* player; Player* player;
......
...@@ -114,7 +114,7 @@ void LevelPlayer::control (unsigned int ticks, int msps) { ...@@ -114,7 +114,7 @@ void LevelPlayer::control (unsigned int ticks, int msps) {
// Check for platform event, bridge or level mask below player // Check for platform event, bridge or level mask below player
platform = (event >= 3) || platform = (event == LPE_PLATFORM) || (event == LPE_BRIDGE) ||
level->checkMaskDown(x + PXO_ML, y + 1) || level->checkMaskDown(x + PXO_ML, y + 1) ||
level->checkMaskDown(x + PXO_MID, y + 1) || level->checkMaskDown(x + PXO_MID, y + 1) ||
level->checkMaskDown(x + PXO_MR, y + 1) || level->checkMaskDown(x + PXO_MR, y + 1) ||
...@@ -160,10 +160,10 @@ void LevelPlayer::control (unsigned int ticks, int msps) { ...@@ -160,10 +160,10 @@ void LevelPlayer::control (unsigned int ticks, int msps) {
} }
if (event) { if (event != LPE_NONE) {
if (event == 1) dy = level->getEvent(eventX, eventY)[E_MULTIPURPOSE] * -F20; if (event == LPE_SPRING) dy = level->getEvent(eventX, eventY)[E_MULTIPURPOSE] * -F20;
else if (event == 2) dy = PYS_JUMP; else if (event == LPE_FLOAT) dy = PYS_JUMP;
} }
...@@ -189,7 +189,7 @@ void LevelPlayer::control (unsigned int ticks, int msps) { ...@@ -189,7 +189,7 @@ void LevelPlayer::control (unsigned int ticks, int msps) {
if (dx < 0) jumpY += dx >> 4; if (dx < 0) jumpY += dx >> 4;
else if (dx > 0) jumpY -= dx >> 4; else if (dx > 0) jumpY -= dx >> 4;
event = 0; event = LPE_NONE;
} }
...@@ -226,14 +226,14 @@ void LevelPlayer::control (unsigned int ticks, int msps) { ...@@ -226,14 +226,14 @@ void LevelPlayer::control (unsigned int ticks, int msps) {
if (dx < 0) jumpY += dx >> 3; if (dx < 0) jumpY += dx >> 3;
else if (dx > 0) jumpY -= dx >> 3; else if (dx > 0) jumpY -= dx >> 3;
event = 0; event = LPE_NONE;
playSound(S_JUMPA); playSound(S_JUMPA);
} }
// Stop jumping // Stop jumping
if (!player->pcontrols[C_JUMP] && (event != 1) && (event != 2)) if (!player->pcontrols[C_JUMP] && (event != LPE_SPRING) && (event != LPE_FLOAT))
jumpY = TTOF(LH); jumpY = TTOF(LH);
if (y >= jumpY) { if (y >= jumpY) {
...@@ -243,7 +243,7 @@ void LevelPlayer::control (unsigned int ticks, int msps) { ...@@ -243,7 +243,7 @@ void LevelPlayer::control (unsigned int ticks, int msps) {
dy = (jumpY - y - F64) * 4; dy = (jumpY - y - F64) * 4;
// Spring/float up speed limit // Spring/float up speed limit
if ((event == 1) || (event == 2)) { if ((event == LPE_SPRING) || (event == LPE_FLOAT)) {
speed = level->getEvent(eventX, eventY)[E_MULTIPURPOSE] * -F20; speed = level->getEvent(eventX, eventY)[E_MULTIPURPOSE] * -F20;
...@@ -254,7 +254,7 @@ void LevelPlayer::control (unsigned int ticks, int msps) { ...@@ -254,7 +254,7 @@ void LevelPlayer::control (unsigned int ticks, int msps) {
} }
// Avoid jumping too fast, unless caused by an event // Avoid jumping too fast, unless caused by an event
if (!event && (dy < PYS_JUMP)) dy = PYS_JUMP; if ((event == LPE_NONE) && (dy < PYS_JUMP)) dy = PYS_JUMP;
} else if (!platform) { } else if (!platform) {
...@@ -265,7 +265,7 @@ void LevelPlayer::control (unsigned int ticks, int msps) { ...@@ -265,7 +265,7 @@ void LevelPlayer::control (unsigned int ticks, int msps) {
} }
// Don't descend through platforms // Don't descend through platforms
if ((dy > 0) && (event >= 3)) dy = 0; if ((dy > 0) && ((event == LPE_PLATFORM) || (event == LPE_BRIDGE))) dy = 0;
if (platform && !lookTime) { if (platform && !lookTime) {
...@@ -284,12 +284,12 @@ void LevelPlayer::control (unsigned int ticks, int msps) { ...@@ -284,12 +284,12 @@ void LevelPlayer::control (unsigned int ticks, int msps) {
// If there is an obstacle above and the player is not floating up, stop // If there is an obstacle above and the player is not floating up, stop
// rising // rising
if (level->checkMaskUp(x + PXO_MID, y + PYO_TOP - F4) && (jumpY < y) && (event != 2)) { if (level->checkMaskUp(x + PXO_MID, y + PYO_TOP - F4) && (jumpY < y) && (event != LPE_FLOAT)) {
jumpY = TTOF(LH); jumpY = TTOF(LH);
if (dy < 0) dy = 0; if (dy < 0) dy = 0;
if ((event != 3) && (event != 4)) event = 0; if ((event != LPE_PLATFORM) && (event != LPE_BRIDGE)) event = LPE_NONE;
} }
...@@ -298,7 +298,7 @@ void LevelPlayer::control (unsigned int ticks, int msps) { ...@@ -298,7 +298,7 @@ void LevelPlayer::control (unsigned int ticks, int msps) {
jumpY = TTOF(LH); jumpY = TTOF(LH);
if ((event != 3) && (event != 4)) event = 0; if ((event != LPE_PLATFORM) && (event != LPE_BRIDGE)) event = LPE_NONE;
} }
...@@ -370,7 +370,7 @@ void LevelPlayer::control (unsigned int ticks, int msps) { ...@@ -370,7 +370,7 @@ void LevelPlayer::control (unsigned int ticks, int msps) {
else if (dy < 0) { else if (dy < 0) {
if (event == 1) animType = facing? PA_RSPRING: PA_LSPRING; if (event == LPE_SPRING) animType = facing? PA_RSPRING: PA_LSPRING;
else animType = facing? PA_RJUMP: PA_LJUMP; else animType = facing? PA_RJUMP: PA_LJUMP;
} else if (platform) { } else if (platform) {
...@@ -385,12 +385,12 @@ void LevelPlayer::control (unsigned int ticks, int msps) { ...@@ -385,12 +385,12 @@ void LevelPlayer::control (unsigned int ticks, int msps) {
} else if (!level->checkMaskDown(x + PXO_ML, y + F12) && } else if (!level->checkMaskDown(x + PXO_ML, y + F12) &&
!level->checkMaskDown(x + PXO_L, y + F2) && !level->checkMaskDown(x + PXO_L, y + F2) &&
(event != 3) && (event != 4)) (event != LPE_PLATFORM) && (event != LPE_BRIDGE))
animType = PA_LEDGE; animType = PA_LEDGE;
else if (!level->checkMaskDown(x + PXO_MR, y + F12) && else if (!level->checkMaskDown(x + PXO_MR, y + F12) &&
!level->checkMaskDown(x + PXO_R, y + F2) && !level->checkMaskDown(x + PXO_R, y + F2) &&
(event != 3) && (event != 4)) (event != LPE_PLATFORM) && (event != LPE_BRIDGE))
animType = PA_REDGE; animType = PA_REDGE;
else if ((lookTime < 0) && ((int)ticks > 1000 - lookTime)) else if ((lookTime < 0) && ((int)ticks > 1000 - lookTime))
...@@ -597,10 +597,10 @@ void LevelPlayer::move (unsigned int ticks, int msps) { ...@@ -597,10 +597,10 @@ void LevelPlayer::move (unsigned int ticks, int msps) {
// If using a float up event and have hit a ceiling, ignore event // If using a float up event and have hit a ceiling, ignore event
if ((event == 2) && level->checkMaskUp(x + PXO_MID, y + PYO_TOP - F4)) { if ((event == LPE_FLOAT) && level->checkMaskUp(x + PXO_MID, y + PYO_TOP - F4)) {
jumpY = TTOF(LH); jumpY = TTOF(LH);
event = 0; event = LPE_NONE;
} }
...@@ -733,7 +733,7 @@ void LevelPlayer::draw (unsigned int ticks, int change) { ...@@ -733,7 +733,7 @@ void LevelPlayer::draw (unsigned int ticks, int change) {
FTOI(-PYO_TOP), 88);*/ FTOI(-PYO_TOP), 88);*/
// Uncomment the following to show the player's event tile // Uncomment the following to show the player's event tile
// if (event) drawRect(FTOI(TTOF(eventX) - viewX), FTOI(TTOF(eventY) - viewY), 32, 32, 89); // if (event != LPE_NONE) drawRect(FTOI(TTOF(eventX) - viewX), FTOI(TTOF(eventY) - viewY), 32, 32, 89);
if (reaction == PR_INVINCIBLE) { if (reaction == PR_INVINCIBLE) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment