Ejemplo n.º 1
0
void CThunderBolt::process()
{
	performCollisions();
	if(!processActionRoutine())
	    exists = false;

}
void CMadMushroom::process()
{

	performGravityMid();
	performCollisions();

	if(!blockedd)
	{
		m_jumped = false;
	}

	if(blockedd && !m_jumped)
	{
		yinertia = -MUSHROOM_LOW_INERTIA;
		jumpcounter++;

		if( jumpcounter>=bounceAmount )
		{
			yinertia = -MUSHROOM_HIGH_INERTIA;
			jumpcounter = 0;
			playSound( SOUND_BOUNCE_HIGH );
		}
		else
		{
			playSound( SOUND_BOUNCE_LOW );
		}

		m_jumped = true;
	}

	if(!processActionRoutine())
			exists = false;
}
Ejemplo n.º 3
0
void CEnemyShot::process()
{    
    m_speedInt += m_speedF;

    if(m_speedInt >= 1.0)
    {
        const int speed = m_speedInt;

        moveXDir(speed*xDirection);
        moveYDir(speed*yDirection);

        m_speedInt -= float(speed);
    }

    
    // If it collides against something, make it non-existent
    if( (blockedd && yDirection == DOWN) ||
            (blockedl && xDirection == LEFT) ||
            (blockedu && yDirection == UP) ||
            (blockedr && xDirection == RIGHT) )
    {
        exists = false;
    }
    
    if(!processActionRoutine())
    {
        exists = false;
    }
}
Ejemplo n.º 4
0
void CWormmouth::getTouchedBy(CSpriteObject &theObject)
{
	if(dead || theObject.dead )
		return;


	CStunnable::getTouchedBy(theObject);


	// Was it a bullet? Than make it stunned.
	if( dynamic_cast<CBullet*>(&theObject) )
	{
		setAction( A_WORMMOUTH_STUNNED );
		dead = true;
		theObject.dead = true;
		if(!processActionRoutine())
				exists = false;
		performCollisions();
		processGettingStunned();
	}


	if( !getActionNumber(A_WORMMOUTH_EAT) )
		return;


	if( CPlayerBase *player = dynamic_cast<CPlayerBase*>(&theObject) )
	{
		player->kill();
	}
}
Ejemplo n.º 5
0
void CAmpton::process()
{
	performCollisions();
	
	if(!getActionNumber(A_AMPTON_POLE_SLIDE))
	  performGravityMid();

	if(!dead) // If we is dead, there is no way to continue moving or turning
	{	
	  if( blockedl )
	  {
	    if(xDirection == LEFT)
	      setAction(A_AMPTON_TURN);
	    
	    xDirection = RIGHT;
	  }
	  else if(blockedr)
	  {
	    if(xDirection == RIGHT)
	      setAction(A_AMPTON_TURN);
	    
	    xDirection = LEFT;
	  }
	}
	
	if(!processActionRoutine())
	    exists = false;
	
	(this->*mp_processState)();
}
Ejemplo n.º 6
0
void CRocket::process()
{
	if(!processActionRoutine())
	    exists = false;
	
	(this->*mp_processState)();
}
Ejemplo n.º 7
0
void CArachnut::process()
{
	performCollisions();
	performGravityLow();

	if( blockedl )
		xDirection = RIGHT;
	else if( blockedr )
		xDirection = LEFT;

	if( getActionStatus(A_ARACHNUT_WALK) )
		setAction(A_ARACHNUT_WALK);

	if( getActionNumber(A_ARACHNUT_WALK) )
	{
		// Move normally in the direction
		if( xDirection == RIGHT )
			moveRight( WALK_SPEED );
		else
			moveLeft( WALK_SPEED );
	}


	if(!processActionRoutine())
			exists = false;
}
Ejemplo n.º 8
0
void CSparky::process()
{
	performCollisions();
	
    performGravityMid();

	if(!dead) // If we is dead, there is no way to continue moving or turning
	{
	  if( blockedl )
	  {
	    if(xDirection == LEFT)
	      setAction(A_SPARKY_TURN);
	    
	    xDirection = RIGHT;
	  }
	  else if(blockedr)
	  {
	    if(xDirection == RIGHT)
	      setAction(A_SPARKY_TURN);
	    
	    xDirection = LEFT;
	  }
	}

	if(!processActionRoutine())
	    exists = false;
	
	(this->*mp_processState)();
}
Ejemplo n.º 9
0
void CShellyFrags::process()
{
	performCollisions();
	
	performGravityMid();

	// Reflections at wall. Not sure, if it makes sense, let's observe the behaviour
	if( (blockedl && mXSpeed < 0) ||
	    (blockedr && mXSpeed > 0) )
	{
	  mXSpeed = -mXSpeed;
	}		
	
	if( blockedd )
	{
	  dead = true;
	  exists = false;
	  return;
	}
	
	
	moveXDir(mXSpeed);
	
	processActionRoutine();	
}
Ejemplo n.º 10
0
void CLick::process()
{
	(this->*mp_processState)();

	processActionRoutine();

	processFalling();
}
Ejemplo n.º 11
0
void CPlayerDive::process()
{
	(this->*mp_processState)();

	processLevelMiscFlagsCheck();

	processActionRoutine();
}
void CWaterMine::process()
{
	(this->*mp_processState)();

	if(!processActionRoutine())
			exists = false;

}
Ejemplo n.º 13
0
void CBlorb::process()
{
	performCollisions();
	
	if(!processActionRoutine())
	    exists = false;
	
	(this->*mp_processState)();	
}
Ejemplo n.º 14
0
void CMimrock::process()
{
	performCollisions();
	processFalling();

	(this->*mp_processState)();

	processActionRoutine();
}
Ejemplo n.º 15
0
void CBullets::process()
{
	if( blockedd || blockedu || blockedl || blockedr )
	{
		setAction(A_KEENSHOT_IMPACT);
	}

	processActionRoutine();
}
Ejemplo n.º 16
0
void CShelly::process()
{
	performCollisions();
	
	performGravityHigh();

	processActionRoutine();
	
	(this->*mp_processState)();
}
Ejemplo n.º 17
0
void CMimrock::process()
{       
    performCollisions();
    performGravityMid();    
	
    processActionRoutine();
        
    (this->*mp_processState)();
    
}
Ejemplo n.º 18
0
void CCouncilMember::process()
{
	(this->*mp_processState)();

	if( blockedl )
		m_hDir = RIGHT;
	else if(blockedr)
		m_hDir = LEFT;

	processActionRoutine();
}
Ejemplo n.º 19
0
void CBullet::process()
{
    if( !getActionNumber(A_KEENSHOT_IMPACT) && (blockedd || blockedu || blockedl || blockedr || onslope) )
    {
        setAction(A_KEENSHOT_IMPACT);
        playSound( SOUND_SHOT_HIT );
        dead = true;
    }

    processActionRoutine();
}
Ejemplo n.º 20
0
void CShikadiMaster::process()
{
	performCollisions();
	
	performGravityMid();

	if(!processActionRoutine())
	    exists = false;
	
	(this->*mp_processState)();
}
Ejemplo n.º 21
0
CMadMushroom::CMadMushroom(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y) :
CGalaxySpriteObject(pmap, foeID, x, y),
jumpcounter(0)
{
	setupGalaxyObjectOnMap(0x20E4, A_MUSHROOM_BOUNCE);

	CSprite &rSprite = g_pGfxEngine->getSprite(sprite);
	performCollisions();
	processMove( 0, rSprite.m_bboxY1-rSprite.m_bboxY2 );
	processActionRoutine();
}
Ejemplo n.º 22
0
CArachnut::CArachnut(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y) :
    CGalaxySpriteObject(pmap, foeID, x, y)
{
    setupGalaxyObjectOnMap( 0x2378, A_ARACHNUT_WALK );
    xDirection = LEFT;

    CSprite &rSprite = g_pGfxEngine->getSprite(sprite);
    performCollisions();
    processMove( 0, rSprite.m_bboxY1-rSprite.m_bboxY2 );
    processActionRoutine();
}
Ejemplo n.º 23
0
void CCouncilMember::process()
{
    (this->*mp_processState)();

    if( blockedl )
        xDirection = RIGHT;
    else if(blockedr)
        xDirection = LEFT;

    if(!processActionRoutine())
        exists = false;
}
Ejemplo n.º 24
0
void CBerkFlame::process()
{

	processFalling();

	performCollisions();

	(this->*mpProcessState)();

	if(!processActionRoutine())
			exists = false;

}
CMadMushroom::CMadMushroom(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y) :
CGalaxySpriteObject(pmap, foeID, x, y, 0),
jumpcounter(0)
{
	setupGalaxyObjectOnMap(0x20E4, A_MUSHROOM_BOUNCE);
	processActionRoutine();
	honorPriority = false;
	
	bounceAmount = 0;

    byte *ptr = gKeenFiles.exeFile.getRawData();
	ptr += 0xFF90;
	memcpy(&bounceAmount, ptr, 1 );
}
Ejemplo n.º 26
0
CArachnut::CArachnut(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y) :
CGalaxySpriteObject(pmap, foeID, x, y, 0)
{
	setupGalaxyObjectOnMap( 0x2378, A_ARACHNUT_WALK );
	xDirection = LEFT;

    GsSprite &rSprite = gGraphics.getSprite(mSprVar, mSpriteIdx);
	performCollisions();

    const int xcentering=(rSprite.m_bboxX2-rSprite.m_bboxX1)/2;

    processMove( xcentering, 0 );
	processActionRoutine();
}
Ejemplo n.º 27
0
void COrbatrix::process()
{
    performCollisions();
        
    if( blockedl )
	xDirection = RIGHT;
    else if(blockedr)
	xDirection = LEFT;
    
    if(!processActionRoutine())
	exists = false;
    
    (this->*mp_processState)();        
}
Ejemplo n.º 28
0
void CLick::process()
{
	performCollisions();
	performGravityMid();

	if( blockedl )
		xDirection = RIGHT;
	else if( blockedr )
		xDirection = LEFT;

	(this->*mp_processState)();

	if(!processActionRoutine())
			exists = false;
}
Ejemplo n.º 29
0
void CPlatform::process()
{
	// check if someone is still standing on the platform
	if(mp_CarriedPlayer)
	{
		if(!hitdetect(*mp_CarriedPlayer) || mp_CarriedPlayer->blockedu)
		{
			mp_CarriedPlayer->supportedbyobject = false;
			mp_CarriedPlayer->m_jumpdownfromobject = false;
			mp_CarriedPlayer = NULL;
		}
	}

	processActionRoutine();
}
Ejemplo n.º 30
0
void CPoisonSlug::process()
{
	performCollisions();
	
	performGravityLow();			

	if( blockedl )
		xDirection = RIGHT;
	else if(blockedr)
		xDirection = LEFT;

	if(!processActionRoutine())
	    exists = false;
	
	(this->*mp_processState)();	
}