mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-12 16:14:25 +02:00
#22 add door latch
This commit is contained in:
@@ -58,7 +58,7 @@
|
||||
E( HAMMER_HANDLE ) \
|
||||
E( HAMMER_BLOCK ) \
|
||||
E( LIGHTNING_BALL ) \
|
||||
E( BARRICADE ) \
|
||||
E( DOOR_LATCH ) \
|
||||
E( BLOCK_1 ) \
|
||||
E( BLOCK_2 ) \
|
||||
E( BLOCK_3 ) \
|
||||
|
@@ -462,6 +462,9 @@ struct Lara : Character {
|
||||
//reset(27, vec3(72372, 8704, 46547), PI * 0.5f); // level 3b (spikes)
|
||||
//reset(5, vec3(73394, 3840, 60758), 0); // level 3b (scion)
|
||||
//reset(20, vec3(57724, 6656, 61941), 90 * DEG2RAD); // level 3b (boulder)
|
||||
//reset(18, vec3(34914, 11008, 41315), 90 * DEG2RAD); // level 4 (main hall)
|
||||
//reset(19, vec3(33368, 19968, 45643), 270 * DEG2RAD); // level 4 (damocles)
|
||||
//reset(24, vec3(45609, 18176, 41500), 90 * DEG2RAD); // level 4 (thor)
|
||||
//reset(99, vec3(45562, -3328, 63366), 225 * DEG2RAD); // level 7a (flipmap)
|
||||
//reset(57, vec3(54844, -3328, 53145), 0); // level 8b (bridge switch)
|
||||
//reset(12, vec3(34236, -2415, 14974), 0); // level 8b (sphinx)
|
||||
|
@@ -419,6 +419,9 @@ struct Level : IGame {
|
||||
case TR::Entity::TRAP_SWORD :
|
||||
entity.controller = new TrapSword(this, i);
|
||||
break;
|
||||
case TR::Entity::DOOR_LATCH :
|
||||
entity.controller = new DoorLatch(this, i);
|
||||
break;
|
||||
case TR::Entity::SWITCH :
|
||||
case TR::Entity::SWITCH_WATER :
|
||||
entity.controller = new Switch(this, i);
|
||||
|
@@ -710,6 +710,23 @@ struct TrapLava : Controller {
|
||||
};
|
||||
|
||||
|
||||
struct DoorLatch : Controller {
|
||||
enum {
|
||||
STATE_CLOSE,
|
||||
STATE_OPEN,
|
||||
};
|
||||
|
||||
DoorLatch(IGame *game, int entity) : Controller(game, entity) {
|
||||
getEntity().flags.collision = true;
|
||||
}
|
||||
|
||||
virtual void update() {
|
||||
updateAnimation(true);
|
||||
animation.setState(isActive() ? STATE_OPEN : STATE_CLOSE);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct Cabin : Controller {
|
||||
enum {
|
||||
STATE_UP,
|
||||
|
Reference in New Issue
Block a user