|
@@ -10,6 +10,7 @@
|
|
|
#include <Rahmen.h>
|
|
|
#include <Globals.h>
|
|
|
#include <AsynchronCall.h>
|
|
|
+#include <Animation.h>
|
|
|
|
|
|
// Inhalt der Map Klasse aus Map.h
|
|
|
// Konstruktor
|
|
@@ -23,6 +24,30 @@ Map::Map( MinigameKlientV *klient )
|
|
|
aTextur = new Bild*[ 7 ]();
|
|
|
sData = new Model2DData*[ 2 ]();
|
|
|
sTextur = new Bild*[ 2 ]();
|
|
|
+ // lade Flammen animation
|
|
|
+ LTDBDatei flammenStartLTDB;
|
|
|
+ flammenStartLTDB.setDatei( new Text( "data/Minigames/Asteroids/bilder/f_start.ltdb" ) );
|
|
|
+ flammenStartLTDB.leseDaten( 0 );
|
|
|
+ Animation2DData *flammenStart = new Animation2DData();
|
|
|
+ flammenStart->ladeAnimation( flammenStartLTDB.getThis() );
|
|
|
+ flammenStart->setFPS( 60 );
|
|
|
+ flammenStart->setWiederhohlend( 0 );
|
|
|
+ LTDBDatei flammenLTDB;
|
|
|
+ flammenLTDB.setDatei( new Text( "data/Minigames/Asteroids/bilder/f_burn.ltdb" ) );
|
|
|
+ Animation2DData *flammenBurn = new Animation2DData();
|
|
|
+ flammenBurn->ladeAnimation( flammenLTDB.getThis() );
|
|
|
+ flammenBurn->setFPS( 60 );
|
|
|
+ flammenBurn->setWiederhohlend( 1 );
|
|
|
+ flammenM = new Textur2D();
|
|
|
+ flammenM->addAnimationZ( flammenStart->getThis() );
|
|
|
+ flammenM->addAnimationZ( flammenBurn->getThis() );
|
|
|
+ flammenL = new Textur2D();
|
|
|
+ flammenL->addAnimationZ( flammenStart->getThis() );
|
|
|
+ flammenL->addAnimationZ( flammenBurn->getThis() );
|
|
|
+ flammenR = new Textur2D();
|
|
|
+ flammenR->addAnimationZ( flammenStart );
|
|
|
+ flammenR->addAnimationZ( flammenBurn );
|
|
|
+
|
|
|
M2Datei m2d( "data/Minigames/Asteroids/models/asteroids.m2" );
|
|
|
m2d.leseDaten();
|
|
|
LTDBDatei td;
|
|
@@ -96,6 +121,9 @@ Map::~Map()
|
|
|
rGen->release();
|
|
|
if( klient )
|
|
|
klient->release();
|
|
|
+ flammenM->release();
|
|
|
+ flammenL->release();
|
|
|
+ flammenR->release();
|
|
|
}
|
|
|
|
|
|
// nicht constant
|
|
@@ -227,7 +255,7 @@ void Map::reset( Text *zOptionen )
|
|
|
tmp->release();
|
|
|
}
|
|
|
}
|
|
|
- ship = new Ship( sData[ shipN ]->getThis(), sTextur[ shipN ]->getThis(), shipPos, shipSpeed, shipR );
|
|
|
+ ship = new Ship( sData[ shipN ]->getThis(), flammenM, flammenL, flammenR, sTextur[ shipN ]->getThis(), shipPos, shipSpeed, shipR );
|
|
|
}
|
|
|
|
|
|
void Map::doMausEreignis( MausEreignis &me )
|
|
@@ -245,23 +273,41 @@ void Map::doTastaturEreignis( TastaturEreignis &te )
|
|
|
if( te.taste == 'w' || te.taste == 'W' || te.taste == T_Oben )
|
|
|
{
|
|
|
if( te.id == TE_Press )
|
|
|
+ {
|
|
|
tastenStände |= 1;
|
|
|
+ flammenM->setAnimation( 0 );
|
|
|
+ }
|
|
|
else
|
|
|
+ {
|
|
|
tastenStände &= ~1;
|
|
|
+ flammenM->setAnimation( -1 );
|
|
|
+ }
|
|
|
}
|
|
|
if( te.taste == 'd' || te.taste == 'D' || te.taste == T_Rechts )
|
|
|
{
|
|
|
if( te.id == TE_Press )
|
|
|
+ {
|
|
|
tastenStände |= 2;
|
|
|
+ flammenL->setAnimation( 0 );
|
|
|
+ }
|
|
|
else
|
|
|
+ {
|
|
|
tastenStände &= ~2;
|
|
|
+ flammenL->setAnimation( -1 );
|
|
|
+ }
|
|
|
}
|
|
|
if( te.taste == 'a' || te.taste == 'A' || te.taste == T_Links )
|
|
|
{
|
|
|
if( te.id == TE_Press )
|
|
|
+ {
|
|
|
tastenStände |= 4;
|
|
|
+ flammenR->setAnimation( 0 );
|
|
|
+ }
|
|
|
else
|
|
|
+ {
|
|
|
tastenStände &= ~4;
|
|
|
+ flammenR->setAnimation( -1 );
|
|
|
+ }
|
|
|
}
|
|
|
if( te.taste == T_Space )
|
|
|
{
|
|
@@ -429,6 +475,9 @@ bool Map::tick( double tickVal )
|
|
|
DateiRemove( "data/Minigames/Asteroids/data/game.save" );
|
|
|
}
|
|
|
cs.unlock();
|
|
|
+ flammenM->tick( tickVal );
|
|
|
+ flammenL->tick( tickVal );
|
|
|
+ flammenR->tick( tickVal );
|
|
|
return 1;
|
|
|
}
|
|
|
|