コード例 #1
0
ファイル: wl_agent.c プロジェクト: AliSayed/MoSync
void UpdateFace()
{
	if (SD_SoundPlaying() == GETGATLINGSND)
		return;

	facecount += tics;
	if (facecount > US_RndT())
	{
		gamestate.faceframe = (US_RndT()>>6);
		if (gamestate.faceframe==3)
			gamestate.faceframe = 1;

		facecount = 0;
		DrawFace();
	}
コード例 #2
0
void UpdateFace (void)
{
    // don't make demo depend on sound playback
    if(demoplayback || demorecord)
    {
        if(facetimes > 0)
        {
            facetimes--;
            return;
        }
    }
    else if(SD_SoundPlaying() == GETGATLINGSND)
        return;

    facecount += tics;
    if (facecount > US_RndT())
    {
        gamestate.faceframe = (US_RndT()>>6);
        if (gamestate.faceframe==3)
            gamestate.faceframe = 1;

        facecount = 0;
        DrawFace ();
    }
コード例 #3
0
void DrawFace (void)
{
    if(viewsize == 21 && ingame) return;
    if (SD_SoundPlaying() == GETGATLINGSND)
        StatusDrawFace(GOTGATLINGPIC);
    else if (gamestate.health)
    {
#ifdef SPEAR
        if (godmode)
            StatusDrawFace(GODMODEFACE1PIC+gamestate.faceframe);
        else
#endif
            StatusDrawFace(FACE1APIC+3*((100-gamestate.health)/16)+gamestate.faceframe);
    }
    else
    {
#ifndef SPEAR
        if (LastAttacker && LastAttacker->obclass == needleobj)
            StatusDrawFace(MUTANTBJPIC);
        else
#endif
            StatusDrawFace(FACE8APIC);
    }
}
コード例 #4
0
void CK6_RocketFly(CK_object *obj)
{
  if (!ck_nextX && !ck_nextY)
  {
    if (!SD_SoundPlaying())
      SD_PlaySound(SOUND_ROCKETFLY);

    int delta = SD_GetSpriteSync() * 32;

    // Will we reach a new tile?
    if (obj->user2 > delta)
    {
      // No... keep moving in the same direction.
      obj->user2 -= delta;

      int dirX = ck_infoplaneArrowsX[obj->user1];
      if (dirX == 1)
      {
        // Moving right.
        ck_nextX += delta;
      }
      else if (dirX == -1)
      {
        // Moving left
        ck_nextX -= delta;
      }

      int dirY = ck_infoplaneArrowsY[obj->user1];
      if (dirY == 1)
      {
        // Moving down
        ck_nextY += delta;
      }
      else if (dirY == -1)
      {
        // Moving up
        ck_nextY -= delta;
      }
    }
    else
    {
      // Move to next tile.
      int dirX = ck_infoplaneArrowsX[obj->user1];
      if (dirX == 1)
      {
        // Moving right.
        ck_nextX += obj->user2;
      }
      else if (dirX == -1)
      {
        // Moving left
        ck_nextX -= obj->user2;
      }

      int dirY = ck_infoplaneArrowsY[obj->user1];
      if (dirY == 1)
      {
        // Moving down
        ck_nextY += obj->user2;
      }
      else if (dirY == -1)
      {
        // Moving up
        ck_nextY -= obj->user2;
      }

      int tileX = (uint16_t)RF_UnitToTile(obj->posX + ck_nextX);
      int tileY = (uint16_t)RF_UnitToTile(obj->posY + ck_nextY);

      obj->user1 = CA_TileAtPos(tileX, tileY, 2) - 0x5B;

      if ((obj->user1 < 0) || (obj->user1 > 8))
      {
        obj->posX += ck_nextX;
        obj->posY += ck_nextY;
        CK_SetAction2(obj, CK_GetActionByName("CK6_ACT_RocketSit0"));

        ck_keenObj->posX = RF_TileToUnit(tileX + 1) + 0x10;
        ck_keenObj->posY = RF_TileToUnit(tileY + 1);
        ck_keenObj->type = CT_Player;
        ck_keenObj->gfxChunk = 0xBD;
        ck_keenObj->clipped = CLIP_normal;
        CK_SetAction(ck_keenObj, CK_GetActionByName("CK_ACT_MapKeenStart"));
        ck_gameState.ep.ck6.inRocket ^= 1;
        return;
      }

      delta -= obj->user2;
      obj->user2 = 256 - delta;

      // Move in the new direction.
      dirX = ck_infoplaneArrowsX[obj->user1];
      if (dirX == 1)
      {
        // Moving right.
        ck_nextX += delta;
      }
      else if (dirX == -1)
      {
        // Moving left
        ck_nextX -= delta;
      }

      dirY = ck_infoplaneArrowsY[obj->user1];
      if (dirY == 1)
      {
        // Moving down
        ck_nextY += delta;
      }
      else if (dirY == -1)
      {
        // Moving up
        ck_nextY -= delta;
      }
    }
  }
}
コード例 #5
0
ファイル: id_sd.cpp プロジェクト: JohnnyonFlame/ecwolf
///////////////////////////////////////////////////////////////////////////
//
//      SD_WaitSoundDone() - waits until the current sound is done playing
//
///////////////////////////////////////////////////////////////////////////
void
SD_WaitSoundDone(void)
{
    while (SD_SoundPlaying())
        SDL_Delay(5);
}
コード例 #6
0
///////////////////////////////////////////////////////////////////////////
//
//      SD_WaitSoundDone() - waits until the current sound is done playing
//
///////////////////////////////////////////////////////////////////////////
void
SD_WaitSoundDone(void)
{
   while (SD_SoundPlaying())
      rarch_sleep(5);
}