Back to index

supertuxkart  0.5+dfsg1
empty_robot.cpp
Go to the documentation of this file.
00001 /* This is a template to avoid writing boring stuff again and again when
00002  * creating a new robot.
00003  *
00004  * Don't forget to replace the copyright in the fourth line of the header in
00005  * this file and the header file, with the current year and your name, the
00006  * #include to <name of your robot>_robot.hpp, the class name references in
00007  * this file and in empty_robot.hpp to <robot name>Robot and the #ifdef at
00008  * beginning of the header file.
00009  *
00010  * You should also delete these intructions. Oh, and if you use this template
00011  * as a robot, it does nothing.
00012  */
00013 
00014 //  SuperTuxKart - a fun racing game with go-kart
00015 //  Copyright (C) 2004-2005 Steve Baker <sjbaker1@airmail.net>
00016 //  Copyright (C) 2006-2007 Eduardo Hernandez Munoz
00017 //  Copyright (C) <insert year here> <insert name here>
00018 //
00019 //  This program is free software; you can redistribute it and/or
00020 //  modify it under the terms of the GNU General Public License
00021 //  as published by the Free Software Foundation; either version 2
00022 //  of the License, or (at your option) any later version.
00023 //
00024 //  This program is distributed in the hope that it will be useful,
00025 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00026 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00027 //  GNU General Public License for more details.
00028 //
00029 //  You should have received a copy of the GNU General Public License
00030 //  along with this program; if not, write to the Free Software
00031 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00032 
00033 #include "world.hpp"
00034 
00035 #include "empty_robot.hpp"
00036 
00037 EmptyRobot::EmptyRobot(const KartProperties *kart_properties, int position,
00038                    sgCoord init_pos) :
00039     AutoKart(kart_properties, position, init_pos)
00040 {
00041     //This is called just once per *competition*
00042 
00043     reset();
00044 }
00045 //-----------------------------------------------------------------------------
00046 void EmptyRobot::update (float delta)
00047 {
00048     /*General kart stuff*/
00049     AutoKart::update(delta);
00050 }
00051 
00052 //-----------------------------------------------------------------------------
00053 void EmptyRobot::reset()
00054 {
00055     //This function is called at the beginning of *each race*
00056 
00057     m_controls.lr      = 0.0;
00058     m_controls.accel   = false;
00059     m_controls.brake   = false;
00060     m_controls.brake   = false;
00061     m_controls.wheelie = false;
00062     m_controls.jump    = false;
00063     m_controls.rescue  = false;
00064     m_controls.fire    = false;
00065     /*General kart stuff*/
00066     AutoKart::reset();
00067 }