initial work towards plunger (still very incomplete, mostly added related files)

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@2459 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2008-11-15 02:59:54 +00:00
parent fa2345375a
commit 33a9864679
11 changed files with 1480 additions and 30 deletions

1420
data/models/plunger.ac Normal file

File diff suppressed because it is too large Load Diff

20
data/plunger.projectile Normal file
View File

@ -0,0 +1,20 @@
;; -*- mode: lisp -*-
(tuxkart-collectable
(name "Plunger")
(model "plunger.ac")
(icon "plungericon.rgb")
(speed 5.0)
(min-height 0.2) ; height above terrain below which a spark is
; started to be pulled up
(max-height 1.0) ; height above terrain at which a spark is
; started to be pulled back to ground
(force-updown 1.0) ; force pushing the spark down
; when it's too high above ground
(force-to-target 15) ; force with which a spark flies towards
; the nearest kart
(max-distance 25) ; maximum distance the spark can be away
; from a kart when accelerating towards it
)
;; EOF ;;

View File

@ -56,23 +56,24 @@ supertuxkart_SOURCES = main.cpp \
utils/ssg_help.cpp utils/ssg_help.hpp \
material_manager.cpp material_manager.hpp \
grand_prix_manager.cpp grand_prix_manager.hpp \
items/attachment.cpp items/attachment.hpp \
items/attachment_manager.cpp items/attachment_manager.hpp \
items/attachment.cpp items/attachment.hpp \
items/attachment_manager.cpp items/attachment_manager.hpp \
items/powerup.cpp items/powerup.hpp \
items/powerup_manager.cpp items/powerup_manager.hpp \
items/powerup_manager.cpp items/powerup_manager.hpp \
items/item.cpp items/item.hpp \
items/item_manager.cpp items/item_manager.hpp \
items/projectile_manager.cpp items/projectile_manager.hpp \
items/bubblegumitem.cpp items/bubblegumitem.hpp \
items/cake.cpp items/cake.hpp \
items/bowling.cpp items/bowling.hpp \
karts/auto_kart.hpp karts/kart_control.hpp \
karts/kart.cpp karts/kart.hpp \
karts/kart_model.cpp karts/kart_model.hpp \
items/item_manager.cpp items/item_manager.hpp \
items/projectile_manager.cpp items/projectile_manager.hpp \
items/bubblegumitem.cpp items/bubblegumitem.hpp \
items/plunger.cpp items/plunger.hpp \
items/cake.cpp items/cake.hpp \
items/bowling.cpp items/bowling.hpp \
karts/auto_kart.hpp karts/kart_control.hpp \
karts/kart.cpp karts/kart.hpp \
karts/kart_model.cpp karts/kart_model.hpp \
karts/kart_properties.cpp karts/kart_properties.hpp \
karts/kart_properties_manager.cpp karts/kart_properties_manager.hpp \
karts/moveable.cpp karts/moveable.hpp \
karts/player_kart.cpp karts/player_kart.hpp \
karts/moveable.cpp karts/moveable.hpp \
karts/player_kart.cpp karts/player_kart.hpp \
smoke.cpp smoke.hpp \
input.hpp \
isect.cpp isect.hpp \
@ -101,7 +102,7 @@ supertuxkart_SOURCES = main.cpp \
sdldrv.cpp sdldrv.hpp \
user_pointer.hpp \
terrain_info.cpp terrain_info.hpp \
triangle_mesh.cpp triangle_mesh.hpp \
triangle_mesh.cpp triangle_mesh.hpp \
flyable.cpp flyable.hpp \
history.cpp history.hpp \
scene.hpp scene.cpp \

View File

@ -32,6 +32,8 @@
9522900B0EC4E1D80090E50F /* moveable.hpp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 95228FFD0EC4E1D80090E50F /* moveable.hpp */; };
9522900C0EC4E1D80090E50F /* player_kart.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95228FFE0EC4E1D80090E50F /* player_kart.cpp */; };
9522900D0EC4E1D80090E50F /* player_kart.hpp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 95228FFF0EC4E1D80090E50F /* player_kart.hpp */; };
957F71270ECE6BBA007C99DE /* plunger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 957F71250ECE6BB9007C99DE /* plunger.cpp */; };
957F71280ECE6BBA007C99DE /* plunger.hpp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 957F71260ECE6BBA007C99DE /* plunger.hpp */; };
958EEFB60EB93C03005F6F70 /* item_info.hpp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 958EEFB50EB93C03005F6F70 /* item_info.hpp */; };
958EF0130EB94819005F6F70 /* powerup_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 958EF00F0EB94818005F6F70 /* powerup_manager.cpp */; };
958EF0140EB94819005F6F70 /* powerup_manager.hpp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 958EF0100EB94819005F6F70 /* powerup_manager.hpp */; };
@ -412,7 +414,6 @@
95B0D35B0EB69DDF001A0D06 /* attachment_manager.hpp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 95B0CE2A0EB69DD9001A0D06 /* attachment_manager.hpp */; };
95B0D35C0EB69DDF001A0D06 /* bowling.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95B0CE2B0EB69DD9001A0D06 /* bowling.cpp */; };
95B0D35D0EB69DDF001A0D06 /* bowling.hpp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 95B0CE2C0EB69DD9001A0D06 /* bowling.hpp */; };
95B0D3690EB69DDF001A0D06 /* missile.hpp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 95B0CE380EB69DD9001A0D06 /* missile.hpp */; };
95B0D36A0EB69DDF001A0D06 /* projectile_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95B0CE390EB69DD9001A0D06 /* projectile_manager.cpp */; };
95B0D36B0EB69DDF001A0D06 /* projectile_manager.hpp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 95B0CE3A0EB69DD9001A0D06 /* projectile_manager.hpp */; };
95B0D3740EB69DDF001A0D06 /* lexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95B0CE440EB69DD9001A0D06 /* lexer.cpp */; };
@ -757,7 +758,6 @@
95B0D3590EB69DDF001A0D06 /* attachment.hpp in CopyFiles */,
95B0D35B0EB69DDF001A0D06 /* attachment_manager.hpp in CopyFiles */,
95B0D35D0EB69DDF001A0D06 /* bowling.hpp in CopyFiles */,
95B0D3690EB69DDF001A0D06 /* missile.hpp in CopyFiles */,
95B0D36B0EB69DDF001A0D06 /* projectile_manager.hpp in CopyFiles */,
95B0D3750EB69DDF001A0D06 /* lexer.hpp in CopyFiles */,
95B0D3770EB69DDF001A0D06 /* lisp.hpp in CopyFiles */,
@ -839,6 +839,7 @@
952290090EC4E1D80090E50F /* kart_properties_manager.hpp in CopyFiles */,
9522900B0EC4E1D80090E50F /* moveable.hpp in CopyFiles */,
9522900D0EC4E1D80090E50F /* player_kart.hpp in CopyFiles */,
957F71280ECE6BBA007C99DE /* plunger.hpp in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 1;
};
@ -870,6 +871,8 @@
95228FFD0EC4E1D80090E50F /* moveable.hpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; name = moveable.hpp; path = ../../karts/moveable.hpp; sourceTree = SOURCE_ROOT; };
95228FFE0EC4E1D80090E50F /* player_kart.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = player_kart.cpp; path = ../../karts/player_kart.cpp; sourceTree = SOURCE_ROOT; };
95228FFF0EC4E1D80090E50F /* player_kart.hpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; name = player_kart.hpp; path = ../../karts/player_kart.hpp; sourceTree = SOURCE_ROOT; };
957F71250ECE6BB9007C99DE /* plunger.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = plunger.cpp; sourceTree = "<group>"; };
957F71260ECE6BBA007C99DE /* plunger.hpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = plunger.hpp; sourceTree = "<group>"; };
958EEFB50EB93C03005F6F70 /* item_info.hpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; name = item_info.hpp; path = ../../network/item_info.hpp; sourceTree = SOURCE_ROOT; };
958EF00F0EB94818005F6F70 /* powerup_manager.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = powerup_manager.cpp; path = ../../items/powerup_manager.cpp; sourceTree = SOURCE_ROOT; };
958EF0100EB94819005F6F70 /* powerup_manager.hpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; name = powerup_manager.hpp; path = ../../items/powerup_manager.hpp; sourceTree = SOURCE_ROOT; };
@ -1250,8 +1253,6 @@
95B0CE2A0EB69DD9001A0D06 /* attachment_manager.hpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; name = attachment_manager.hpp; path = ../../items/attachment_manager.hpp; sourceTree = SOURCE_ROOT; };
95B0CE2B0EB69DD9001A0D06 /* bowling.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = bowling.cpp; path = ../../items/bowling.cpp; sourceTree = SOURCE_ROOT; };
95B0CE2C0EB69DD9001A0D06 /* bowling.hpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; name = bowling.hpp; path = ../../items/bowling.hpp; sourceTree = SOURCE_ROOT; };
95B0CE370EB69DD9001A0D06 /* missile.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = missile.cpp; path = ../../items/missile.cpp; sourceTree = SOURCE_ROOT; };
95B0CE380EB69DD9001A0D06 /* missile.hpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; name = missile.hpp; path = ../../items/missile.hpp; sourceTree = SOURCE_ROOT; };
95B0CE390EB69DD9001A0D06 /* projectile_manager.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = projectile_manager.cpp; path = ../../items/projectile_manager.cpp; sourceTree = SOURCE_ROOT; };
95B0CE3A0EB69DD9001A0D06 /* projectile_manager.hpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; name = projectile_manager.hpp; path = ../../items/projectile_manager.hpp; sourceTree = SOURCE_ROOT; };
95B0CE440EB69DD9001A0D06 /* lexer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = lexer.cpp; path = ../../lisp/lexer.cpp; sourceTree = SOURCE_ROOT; };
@ -2320,6 +2321,8 @@
95B0CE260EB69DD9001A0D06 /* items */ = {
isa = PBXGroup;
children = (
957F71250ECE6BB9007C99DE /* plunger.cpp */,
957F71260ECE6BBA007C99DE /* plunger.hpp */,
951DF9B30EC2899200F18CE6 /* bubblegumitem.cpp */,
951DF9B40EC2899200F18CE6 /* bubblegumitem.hpp */,
958EF00F0EB94818005F6F70 /* powerup_manager.cpp */,
@ -2338,8 +2341,6 @@
95090A460EB7EA960048841A /* item.hpp */,
95090A470EB7EA960048841A /* item_manager.hpp */,
95090A480EB7EA960048841A /* item_manager.cpp */,
95B0CE370EB69DD9001A0D06 /* missile.cpp */,
95B0CE380EB69DD9001A0D06 /* missile.hpp */,
95B0CE390EB69DD9001A0D06 /* projectile_manager.cpp */,
95B0CE3A0EB69DD9001A0D06 /* projectile_manager.hpp */,
);
@ -3035,6 +3036,7 @@
952290080EC4E1D80090E50F /* kart_properties_manager.cpp in Sources */,
9522900A0EC4E1D80090E50F /* moveable.cpp in Sources */,
9522900C0EC4E1D80090E50F /* player_kart.cpp in Sources */,
957F71270ECE6BBA007C99DE /* plunger.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@ -17,11 +17,11 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "missile.hpp"
#include "items/plunger.hpp"
#include "constants.hpp"
// -----------------------------------------------------------------------------
Missile::Missile(Kart *kart) : Flyable(kart, POWERUP_MISSILE)
Plunger::Plunger(Kart *kart) : Flyable(kart, POWERUP_PLUNGER)
{
float y_offset=kart->getKartLength()+2.0f*m_extend.getY();
createPhysics(y_offset, btVector3(0.0f, m_speed, 0.0f),
@ -29,13 +29,13 @@ Missile::Missile(Kart *kart) : Flyable(kart, POWERUP_MISSILE)
} // Missile
// -----------------------------------------------------------------------------
void Missile::init(const lisp::Lisp* lisp, ssgEntity *missile)
void Plunger::init(const lisp::Lisp* lisp, ssgEntity *missile)
{
Flyable::init(lisp, missile, POWERUP_MISSILE);
Flyable::init(lisp, missile, POWERUP_PLUNGER);
} // init
// -----------------------------------------------------------------------------
void Missile::update(float dt)
void Plunger::update(float dt)
{
Flyable::update(dt);
} // update

View File

@ -22,13 +22,12 @@
#include "flyable.hpp"
class Missile : public Flyable
class Plunger : public Flyable
{
public:
Missile(Kart *kart);
Plunger(Kart *kart);
static void init (const lisp::Lisp* lisp, ssgEntity* missile);
virtual void update (float dt);
virtual void hitTrack () { explode(NULL); }
}; // Missile

View File

@ -89,7 +89,8 @@ void Powerup::use()
break ;
case POWERUP_CAKE:
case POWERUP_BOWLING:
case POWERUP_PLUNGER:
m_sound_shot->position(m_owner->getXYZ());
m_sound_shot->play();
projectile_manager->newProjectile(m_owner, m_type);

View File

@ -26,6 +26,7 @@
#include "translation.hpp"
#include "items/bowling.hpp"
#include "items/cake.hpp"
#include "items/plunger.hpp"
#include "loader.hpp"
#if defined(WIN32) && !defined(__CYGWIN__)
@ -47,6 +48,7 @@ initPowerupType ict[]=
{POWERUP_CAKE, "cake.projectile" },
{POWERUP_ANVIL, "anvil.collectable" },
{POWERUP_PARACHUTE, "parachute.collectable" },
{POWERUP_PLUNGER, "plunger.projectile" },
{POWERUP_MAX, "" },
};
@ -136,6 +138,8 @@ void PowerupManager::LoadNode(const lisp::Lisp* lisp, int collectType )
switch (collectType) {
case POWERUP_BOWLING:
Bowling::init (lisp, m_all_models[collectType]); break;
case POWERUP_PLUNGER:
Plunger::init (lisp, m_all_models[collectType]); break;
//case POWERUP_BUBBLEGUM:
// BubbleGum::init(lisp, m_all_models[collectType]); break;
case POWERUP_CAKE:

View File

@ -31,7 +31,7 @@ class ssgEntity;
// zipper just before them (see Powerup::hitBonusBox).
enum PowerupType {POWERUP_NOTHING,
POWERUP_BUBBLEGUM, POWERUP_CAKE,
POWERUP_BOWLING, POWERUP_ZIPPER,
POWERUP_BOWLING, POWERUP_ZIPPER, POWERUP_PLUNGER,
POWERUP_PARACHUTE, POWERUP_ANVIL, //powerup.cpp assumes these two come last
POWERUP_MAX};

View File

@ -23,6 +23,7 @@
#include "items/projectile_manager.hpp"
#include "items/bowling.hpp"
#include "items/cake.hpp"
#include "items/plunger.hpp"
#include "explosion.hpp"
#include "items/powerup_manager.hpp"
#include "items/powerup.hpp"
@ -185,6 +186,7 @@ Flyable *ProjectileManager::newProjectile(Kart *kart, PowerupType type)
switch(type)
{
case POWERUP_BOWLING: f = new Bowling(kart); break;
case POWERUP_PLUNGER: f = new Plunger(kart); break;
case POWERUP_CAKE: f = new Cake(kart); break;
// case POWERUP_BUBBLEGUM: f = new BubbleGum(kart); break;
default: return NULL;

View File

@ -390,6 +390,7 @@ void DefaultRobot::handle_items( const float DELTA, const int STEPS )
break;
case POWERUP_BOWLING:
case POWERUP_PLUNGER:
if ( m_time_since_last_shot > 3.0f && m_crashes.m_kart != -1 )
{
m_controls.fire = true;