static const float Y_OFFSCREEN_DISTANCE = 1200;
BadGuy::BadGuy(const Vector& pos, const std::string& sprite_name, int layer)
- : MovingSprite(pos, sprite_name, layer, COLGROUP_DISABLED), countMe(true), dir(LEFT), state(STATE_INIT)
+ : MovingSprite(pos, sprite_name, layer, COLGROUP_DISABLED), countMe(true), dir(LEFT), start_dir(AUTO), state(STATE_INIT)
+{
+ start_position = bbox.p1;
+
+ sound_manager->preload("sounds/squish.wav");
+ sound_manager->preload("sounds/fall.wav");
+}
+
+BadGuy::BadGuy(const Vector& pos, Direction direction, const std::string& sprite_name, int layer)
+ : MovingSprite(pos, sprite_name, layer, COLGROUP_DISABLED), countMe(true), dir(direction), start_dir(direction), state(STATE_INIT)
{
start_position = bbox.p1;
}
BadGuy::BadGuy(const lisp::Lisp& reader, const std::string& sprite_name, int layer)
- : MovingSprite(reader, sprite_name, layer, COLGROUP_DISABLED), countMe(true), dir(LEFT), state(STATE_INIT)
+ : MovingSprite(reader, sprite_name, layer, COLGROUP_DISABLED), countMe(true), dir(LEFT), start_dir(AUTO), state(STATE_INIT)
{
start_position = bbox.p1;
+ std::string dir_str = "auto";
+ reader.get("direction", dir_str);
+ start_dir = str2dir( dir_str );
+ dir = start_dir;
+
sound_manager->preload("sounds/squish.wav");
sound_manager->preload("sounds/fall.wav");
}
Direction
BadGuy::str2dir( std::string dir_str )
{
- if( dir_str == "auto" || dir_str == "" )
- return dir;
+ if( dir_str == "auto" )
+ return AUTO;
if( dir_str == "left" )
return LEFT;
if( dir_str == "right" )
start_position.x < scroll_x - bbox.get_width() &&
start_position.y > scroll_y - Y_OFFSCREEN_DISTANCE &&
start_position.y < scroll_y + Y_OFFSCREEN_DISTANCE) {
- dir = RIGHT;
+ if (start_dir != AUTO) dir = start_dir; else dir = RIGHT;
set_state(STATE_ACTIVE);
activate();
//Badguy right of screen
start_position.x < scroll_x + SCREEN_WIDTH + X_OFFSCREEN_DISTANCE &&
start_position.y > scroll_y - Y_OFFSCREEN_DISTANCE &&
start_position.y < scroll_y + Y_OFFSCREEN_DISTANCE) {
- dir = LEFT;
+ if (start_dir != AUTO) dir = start_dir; else dir = LEFT;
set_state(STATE_ACTIVE);
activate();
//Badguy over or under screen
start_position.y < scroll_y + SCREEN_HEIGHT + Y_OFFSCREEN_DISTANCE) ||
(start_position.y > scroll_y - Y_OFFSCREEN_DISTANCE &&
start_position.y < scroll_y - bbox.get_height() ))) {
- dir = start_position.x < scroll_x ? RIGHT : LEFT;
+ if (start_dir != AUTO) dir = start_dir; else dir = start_position.x < scroll_x ? RIGHT : LEFT;
set_state(STATE_ACTIVE);
activate();
} else if(state == STATE_INIT
&& start_position.x < scroll_x + X_OFFSCREEN_DISTANCE
&& start_position.y > scroll_y - Y_OFFSCREEN_DISTANCE
&& start_position.y < scroll_y + Y_OFFSCREEN_DISTANCE) {
- dir = LEFT;
+ if (start_dir != AUTO) dir = start_dir; else dir = LEFT;
set_state(STATE_ACTIVE);
activate();
}
{
public:
BadGuy(const Vector& pos, const std::string& sprite_name, int layer = LAYER_OBJECTS);
+ BadGuy(const Vector& pos, Direction direction, const std::string& sprite_name, int layer = LAYER_OBJECTS);
BadGuy(const lisp::Lisp& reader, const std::string& sprite_name, int layer = LAYER_OBJECTS);
/** Called when the badguy is drawn. The default implementation simply draws
Vector start_position;
+ /**
+ * The direction we currently face in
+ */
Direction dir;
/**
+ * The direction we initially faced in
+ */
+ Direction start_dir;
+
+ /**
* Get Direction from String.
*/
Direction str2dir( std::string dir_str );
#include "object/sprite_particle.hpp"
Bomb::Bomb(const Vector& pos, Direction dir)
- : BadGuy(pos, "images/creatures/mr_cherry/cherry.sprite")
+ : BadGuy(pos, dir, "images/creatures/mr_cherry/cherry.sprite")
{
state = STATE_TICKING;
- this->dir = dir;
set_action(dir == LEFT ? "ticking-left" : "ticking-right", 1);
countMe = false;
BouncingSnowball::BouncingSnowball(const lisp::Lisp& reader)
: BadGuy(reader, "images/creatures/bouncing_snowball/bouncing_snowball.sprite")
{
- set_direction = false;
- reader.get("direction", direction);
- if( direction != "auto" && direction != ""){
- set_direction = true;
- initial_direction = str2dir( direction );
- }
}
BouncingSnowball::BouncingSnowball(const Vector& pos, Direction d)
- : BadGuy(pos, "images/creatures/bouncing_snowball/bouncing_snowball.sprite")
+ : BadGuy(pos, d, "images/creatures/bouncing_snowball/bouncing_snowball.sprite")
{
- set_direction = true;
- initial_direction = d;
}
void
{
writer.start_list("bouncingsnowball");
- writer.write_string("direction", direction);
writer.write_float("x", start_position.x);
writer.write_float("y", start_position.y);
void
BouncingSnowball::activate()
{
- if (set_direction) {dir = initial_direction;}
physic.set_velocity_x(dir == LEFT ? -WALKSPEED : WALKSPEED);
sprite->set_action(dir == LEFT ? "left" : "right");
}
protected:
bool collision_squished(Player& player);
- bool set_direction;
- Direction initial_direction;
- std::string direction;
};
#endif
static const std::string SOUNDFILE = "sounds/flame.wav";
Dart::Dart(const lisp::Lisp& reader)
- : BadGuy(reader, "images/creatures/dart/dart.sprite"), set_direction(false), parent(0)
+ : BadGuy(reader, "images/creatures/dart/dart.sprite"), parent(0)
{
physic.enable_gravity(false);
countMe = false;
}
Dart::Dart(const Vector& pos, Direction d, const BadGuy* parent = 0)
- : BadGuy(pos, "images/creatures/dart/dart.sprite"), set_direction(true), initial_direction(d), parent(parent)
+ : BadGuy(pos, d, "images/creatures/dart/dart.sprite"), parent(parent)
{
physic.enable_gravity(false);
countMe = false;
}
Dart::Dart(const Dart& other)
- : BadGuy(other), set_direction(other.set_direction), initial_direction(other.initial_direction), parent(other.parent)
+ : BadGuy(other), parent(other.parent)
{
sound_source.reset(sound_manager->create_sound_source(SOUNDFILE));
sound_manager->preload("sounds/darthit.wav");
void
Dart::activate()
-{
- if (set_direction) dir = initial_direction;
+{
physic.set_velocity_x(dir == LEFT ? -::SPEED : ::SPEED);
sprite->set_action(dir == LEFT ? "flying-left" : "flying-right");
virtual bool updatePointers(const GameObject* from_object, GameObject* to_object);
protected:
- bool set_direction;
- Direction initial_direction;
const BadGuy* parent; /**< collisions with this BadGuy will be ignored */
std::auto_ptr<SoundSource> sound_source; /**< SoundSource for ambient sound */
};
}
DartTrap::DartTrap(const lisp::Lisp& reader)
- : BadGuy(reader, "images/creatures/darttrap/darttrap.sprite"), set_direction(true), initial_direction(LEFT), initial_delay(0), fire_delay(2), ammo(-1), state(IDLE)
+ : BadGuy(reader, "images/creatures/darttrap/darttrap.sprite"), initial_delay(0), fire_delay(2), ammo(-1), state(IDLE)
{
- reader.get("direction", direction);
- if( direction != "auto" && direction != ""){
- initial_direction = str2dir( direction );
- }
reader.get("initial-delay", initial_delay);
reader.get("fire-delay", fire_delay);
reader.get("ammo", ammo);
DartTrap::write(lisp::Writer& writer)
{
writer.start_list("darttrap");
- writer.write_string("direction", direction);
writer.write_float("x", start_position.x);
writer.write_float("y", start_position.y);
writer.write_float("initial-delay", initial_delay);
void
DartTrap::activate()
{
- if (set_direction) dir = initial_direction;
state = IDLE;
sprite->set_action(dir == LEFT ? "idle-left" : "idle-right");
void load(); /**< load a shot */
void fire(); /**< fire a shot */
- bool set_direction;
- Direction initial_direction;
float initial_delay; /**< time to wait before firing first shot */
float fire_delay; /**< reload time */
int ammo; /**< ammo left (-1 means unlimited) */
State state; /**< current state */
Timer fire_timer; /**< time until new shot is fired */
- std::string direction;
};
#endif
Dispenser::Dispenser(const lisp::Lisp& reader)
: BadGuy(reader, "images/creatures/dispenser/dispenser.sprite")
{
- set_direction = false;
- reader.get("direction", direction);
- if( direction != "auto" && direction != ""){
- set_direction = true;
- initial_direction = str2dir( direction );
- dir = str2dir( direction );
- }
reader.get("cycle", cycle);
reader.get("badguy", badguy);
if (badguy == "mrrocket") {
{
writer.start_list("dispenser");
- writer.write_string("direction", direction);
writer.write_float("x", start_position.x);
writer.write_float("y", start_position.y);
writer.write_float("cycle", cycle);
void
Dispenser::launch_badguy()
{
- if( set_direction ){
- dir = initial_direction;
- }
//FIXME: Does is_offscreen() work right here?
if (!is_offscreen()) {
if (badguy == "snowball")
float cycle;
std::string badguy;
Timer dispense_timer;
- bool set_direction;
- Direction initial_direction;
- std::string direction;
};
#endif
-// $Id: igel.cpp 3478 2006-04-30 23:14:15Z sommer $
+// $Id$
//
// SuperTux - Badguy "Igel"
// Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
Igel::Igel(const lisp::Lisp& reader)
: BadGuy(reader, "images/creatures/igel/igel.sprite"), state(STATE_NORMAL)
{
- set_direction = false;
}
Igel::Igel(const Vector& pos, Direction d)
- : BadGuy(pos, "images/creatures/igel/igel.sprite"), state(STATE_NORMAL)
+ : BadGuy(pos, d, "images/creatures/igel/igel.sprite"), state(STATE_NORMAL)
{
- set_direction = true;
- initial_direction = d;
}
void
void
Igel::activate()
{
- if (set_direction) {dir = initial_direction;}
-
be_normal();
}
-// $Id: igel.hpp 3452 2006-04-27 18:19:15Z sommer $
+// $Id$
//
// SuperTux - Badguy "Igel"
// Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
};
State state;
Timer turn_recover_timer; /**< wait time until we will turn around again when shot at */
- bool set_direction;
- Direction initial_direction;
};
#endif
MrBomb::MrBomb(const lisp::Lisp& reader)
: BadGuy(reader, "images/creatures/mr_cherry/mr_cherry.sprite")
{
- set_direction = false;
- reader.get("direction", direction);
- if( direction != "auto" && direction != ""){
- set_direction = true;
- initial_direction = str2dir( direction );
- }
}
MrBomb::MrBomb(const Vector& pos, Direction d)
- : BadGuy(pos, "images/creatures/mr_cherry/mr_cherry.sprite")
+ : BadGuy(pos, d, "images/creatures/mr_cherry/mr_cherry.sprite")
{
- set_direction = true;
- initial_direction = d;
}
void
{
writer.start_list("mrbomb");
- writer.write_string("direction", direction);
writer.write_float("x", start_position.x);
writer.write_float("y", start_position.y);
void
MrBomb::activate()
{
- if (set_direction) {dir = initial_direction;}
physic.set_velocity_x(dir == LEFT ? -WALKSPEED : WALKSPEED);
sprite->set_action(dir == LEFT ? "left" : "right");
}
protected:
bool collision_squished(Player& player);
- bool set_direction;
- Direction initial_direction;
- std::string direction;
};
#endif
MrIceBlock::MrIceBlock(const lisp::Lisp& reader)
: BadGuy(reader, "images/creatures/mr_iceblock/mr_iceblock.sprite"), ice_state(ICESTATE_NORMAL), squishcount(0)
{
- reader.get("direction", direction);
- set_direction = false;
- if( direction != "auto" && direction != ""){
- set_direction = true;
- initial_direction = str2dir( direction );
- }
sound_manager->preload("sounds/iceblock_bump.wav");
sound_manager->preload("sounds/stomp.wav");
sound_manager->preload("sounds/kick.wav");
}
MrIceBlock::MrIceBlock(const Vector& pos, Direction d)
- : BadGuy(pos, "images/creatures/mr_iceblock/mr_iceblock.sprite"), ice_state(ICESTATE_NORMAL), squishcount(0)
+ : BadGuy(pos, d, "images/creatures/mr_iceblock/mr_iceblock.sprite"), ice_state(ICESTATE_NORMAL), squishcount(0)
{
- set_direction = true;
- initial_direction = d;
sound_manager->preload("sounds/iceblock_bump.wav");
sound_manager->preload("sounds/stomp.wav");
sound_manager->preload("sounds/kick.wav");
{
writer.start_list("mriceblock");
- writer.write_string("direction", direction);
writer.write_float("x", start_position.x);
writer.write_float("y", start_position.y);
void
MrIceBlock::activate()
{
- if (set_direction) {
- dir = initial_direction;
- }
-
physic.set_velocity_x(dir == LEFT ? -WALKSPEED : WALKSPEED);
sprite->set_action(dir == LEFT ? "left" : "right");
set_state(ICESTATE_NORMAL);
IceState ice_state;
Timer flat_timer;
int squishcount;
- bool set_direction;
- Direction initial_direction;
- std::string direction;
};
#endif
MrRocket::MrRocket(const lisp::Lisp& reader)
: BadGuy(reader, "images/creatures/mr_rocket/mr_rocket.sprite")
{
- set_direction = false;
}
MrRocket::MrRocket(const Vector& pos, Direction d)
- : BadGuy(pos, "images/creatures/mr_rocket/mr_rocket.sprite")
+ : BadGuy(pos, d, "images/creatures/mr_rocket/mr_rocket.sprite")
{
- set_direction = true;
- initial_direction = d;
}
void
void
MrRocket::activate()
{
- if (set_direction) {dir = initial_direction;}
physic.set_velocity_x(dir == LEFT ? -SPEED : SPEED);
physic.enable_gravity(false);
sprite->set_action(dir == LEFT ? "left" : "right");
protected:
bool collision_squished(Player& player);
- bool set_direction;
- Direction initial_direction;
Timer collision_timer;
};
MrTree::MrTree(const lisp::Lisp& reader)
: BadGuy(reader, "images/creatures/mr_tree/mr_tree.sprite"), mystate(STATE_BIG)
{
- reader.get("direction", direction);
- set_direction = false;
- if( direction != "auto" && direction != ""){
- set_direction = true;
- initial_direction = str2dir( direction );
- dir = str2dir( direction );
- }
sprite->set_action(dir == LEFT ? "large-left" : "large-right");
sound_manager->preload("sounds/mr_tree.ogg");
sound_manager->preload("sounds/mr_treehit.ogg");
{
writer.start_list("mrtree");
- writer.write_string("direction", direction);
writer.write_float("x", start_position.x);
writer.write_float("y", start_position.y);
void
MrTree::activate()
{
- if( set_direction ){
- dir = initial_direction;
- }
if (mystate == STATE_BIG) {
physic.set_velocity_x(dir == LEFT ? -WALKSPEED : WALKSPEED);
sprite->set_action(dir == LEFT ? "large-left" : "large-right");
physic.set_velocity_y(0);
} else {
dir = dir == LEFT ? RIGHT : LEFT;
- set_direction = false;
activate();
}
{
if(fabsf(hit.normal.x) > .8) { // left or right hit
dir = dir == LEFT ? RIGHT : LEFT;
- set_direction = false;
activate();
}
Timer invincible_timer;
bool collision_squished(Player& player);
- std::string direction;
- bool set_direction;
- Direction initial_direction;
};
#endif
PoisonIvy::PoisonIvy(const lisp::Lisp& reader)
: BadGuy(reader, "images/creatures/poison_ivy/poison_ivy.sprite")
{
- set_direction = false;
- reader.get("direction", direction);
- if( direction != "auto" && direction != ""){
- set_direction = true;
- initial_direction = str2dir( direction );
- }
}
PoisonIvy::PoisonIvy(const Vector& pos, Direction d)
- : BadGuy(pos, "images/creatures/poison_ivy/poison_ivy.sprite")
+ : BadGuy(pos, d, "images/creatures/poison_ivy/poison_ivy.sprite")
{
- set_direction = true;
- initial_direction = d;
}
void
{
writer.start_list("poisonivy");
- writer.write_string("direction", direction);
writer.write_float("x", start_position.x);
writer.write_float("y", start_position.y);
void
PoisonIvy::activate()
{
- if (set_direction) {dir = initial_direction;}
physic.set_velocity_x(dir == LEFT ? -WALKSPEED : WALKSPEED);
sprite->set_action(dir == LEFT ? "left" : "right");
}
protected:
bool collision_squished(Player& player);
- bool set_direction;
- Direction initial_direction;
- std::string direction;
};
#endif
static const float EXPLOSIONTIME = 1;
RocketExplosion::RocketExplosion(const Vector& pos, Direction dir)
- : BadGuy(pos, "images/creatures/mr_rocket/explosion.sprite")
+ : BadGuy(pos, dir, "images/creatures/mr_rocket/explosion.sprite")
{
- this->dir = dir;
countMe = false;
explode();
}
SkullyHop::SkullyHop(const lisp::Lisp& reader)
: BadGuy(reader, "images/creatures/skullyhop/skullyhop.sprite")
{
- has_initial_direction = false;
}
SkullyHop::SkullyHop(const Vector& pos, Direction d)
- : BadGuy(pos, "images/creatures/skullyhop/skullyhop.sprite")
+ : BadGuy(pos, d, "images/creatures/skullyhop/skullyhop.sprite")
{
- has_initial_direction = true;
- initial_direction = d;
}
void
void
SkullyHop::activate()
{
- if (has_initial_direction) dir = initial_direction;
-
// initial state is JUMPING, because we might start airborne
state = JUMPING;
sprite->set_action(dir == LEFT ? "jumping-left" : "jumping-right");
JUMPING
};
- bool has_initial_direction;
- Direction initial_direction;
-
Timer recover_timer;
SkullyHopState state;
Snail::Snail(const lisp::Lisp& reader)
: BadGuy(reader, "images/creatures/snail/snail.sprite"), state(STATE_NORMAL), squishcount(0)
{
- reader.get("direction", direction);
- set_direction = false;
- if( direction != "auto" && direction != ""){
- set_direction = true;
- initial_direction = str2dir( direction );
- }
sound_manager->preload("sounds/iceblock_bump.wav");
sound_manager->preload("sounds/stomp.wav");
sound_manager->preload("sounds/kick.wav");
}
Snail::Snail(const Vector& pos, Direction d)
- : BadGuy(pos, "images/creatures/snail/snail.sprite"), state(STATE_NORMAL), squishcount(0)
+ : BadGuy(pos, d, "images/creatures/snail/snail.sprite"), state(STATE_NORMAL), squishcount(0)
{
- set_direction = true;
- initial_direction = d;
sound_manager->preload("sounds/iceblock_bump.wav");
sound_manager->preload("sounds/stomp.wav");
sound_manager->preload("sounds/kick.wav");
{
writer.start_list("snail");
- writer.write_string("direction", direction);
writer.write_float("x", start_position.x);
writer.write_float("y", start_position.y);
void
Snail::activate()
{
- if (set_direction) {dir = initial_direction;}
-
be_normal();
}
Timer flat_timer; /**< wait time until flipping right-side-up again */
Timer kicked_delay_timer; /**< wait time until switching from STATE_KICKED_DELAY to STATE_KICKED */
int squishcount;
- bool set_direction;
- Direction initial_direction;
- std::string direction;
};
#endif
SnowBall::SnowBall(const lisp::Lisp& reader)
: BadGuy(reader, "images/creatures/snowball/snowball.sprite")
{
- set_direction = false;
- reader.get("direction", direction);
- if( direction != "auto" && direction != ""){
- set_direction = true;
- initial_direction = str2dir( direction );
- }
}
SnowBall::SnowBall(const Vector& pos, Direction d)
- : BadGuy(pos, "images/creatures/snowball/snowball.sprite")
+ : BadGuy(pos, d, "images/creatures/snowball/snowball.sprite")
{
- set_direction = true;
- initial_direction = d;
}
void
{
writer.start_list("snowball");
- writer.write_string("direction", direction);
writer.write_float("x", start_position.x);
writer.write_float("y", start_position.y);
/*
void
SnowBall::activate()
{
- if (set_direction) {dir = initial_direction;}
physic.set_velocity_x(dir == LEFT ? -WALKSPEED : WALKSPEED);
sprite->set_action(dir == LEFT ? "left" : "right");
}
protected:
bool collision_squished(Player& player);
- bool set_direction;
- Direction initial_direction;
- std::string direction;
};
#endif
Spiky::Spiky(const lisp::Lisp& reader)
: BadGuy(reader, "images/creatures/spiky/spiky.sprite")
{
- reader.get("direction", direction);
- set_direction = false;
- if( direction != "auto" && direction != ""){
- set_direction = true;
- initial_direction = str2dir( direction );
- }
}
void
{
writer.start_list("spiky");
- writer.write_string("direction", direction);
writer.write_float("x", start_position.x);
writer.write_float("y", start_position.y);
void
Spiky::activate()
{
- if( set_direction ){
- dir = initial_direction;
- }
physic.set_velocity_x(dir == LEFT ? -WALKSPEED : WALKSPEED);
sprite->set_action(dir == LEFT ? "left" : "right");
}
virtual Spiky* clone() const { return new Spiky(*this); }
private:
- bool set_direction;
- Direction initial_direction;
- std::string direction;
};
#endif
SSpiky::SSpiky(const lisp::Lisp& reader)
: BadGuy(reader, "images/creatures/spiky/sleepingspiky.sprite"), state(SSPIKY_SLEEPING)
{
- set_direction = false;
- reader.get("direction", direction);
- if( direction != "auto" && direction != ""){
- set_direction = true;
- initial_direction = str2dir( direction );
- }
}
void
{
writer.start_list("sspiky");
- writer.write_string("direction", direction);
writer.write_float("x", start_position.x);
writer.write_float("y", start_position.y);
void
SSpiky::activate()
{
- if( set_direction ){
- dir = initial_direction;
- }
state = SSPIKY_SLEEPING;
physic.set_velocity_x(0);
sprite->set_action(dir == LEFT ? "sleeping-left" : "sleeping-right");
SSPIKY_WALKING
};
SSpikyState state;
- std::string direction;
- bool set_direction;
- Direction initial_direction;
};
#endif
Zeekling::Zeekling(const lisp::Lisp& reader)
: BadGuy(reader, "images/creatures/zeekling/zeekling.sprite")
{
- set_direction = false;
- reader.get("direction", direction);
- if( direction != "auto" && direction != ""){
- set_direction = true;
- initial_direction = str2dir( direction );
- }
state = FLYING;
}
Zeekling::Zeekling(const Vector& pos, Direction d)
- : BadGuy(pos, "images/creatures/zeekling/zeekling.sprite")
+ : BadGuy(pos, d, "images/creatures/zeekling/zeekling.sprite")
{
- set_direction = true;
- initial_direction = d;
state = FLYING;
}
{
writer.start_list("zeekling");
- writer.write_string("direction", direction);
writer.write_float("x", start_position.x);
writer.write_float("y", start_position.y);
Zeekling::activate()
{
speed = systemRandom.rand(130, 171);
- if (set_direction) {dir = initial_direction;}
physic.set_velocity_x(dir == LEFT ? -speed : speed);
physic.enable_gravity(false);
sprite->set_action(dir == LEFT ? "left" : "right");
protected:
bool collision_squished(Player& player);
- bool set_direction;
- Direction initial_direction;
float speed;
Timer diveRecoverTimer;
bool should_we_dive();
void onBumpHorizontal();
void onBumpVertical();
- std::string direction;
};
#endif
#ifndef SUPERTUX_DIRECTION_H
#define SUPERTUX_DIRECTION_H
-enum Direction { LEFT = 0, RIGHT = 1 };
+enum Direction { AUTO, LEFT, RIGHT };
#endif