Exemplo n.º 1
0
void GameManager_UpdateEnnemyWaves(GameManager* gm, World* world)
{
    gm->wave_timer -= delta_g;


    if(Vector_Count(&world->monsters_vector) == 0 || gm->wave_timer <= 0)
    {
        gm->wave_timer = 30000;
        int randX = 0;
        int randY = 0;

        for(int z_type = 0 ; z_type < NB_ZOMBIE_TYPES ; z_type++)
        {
            for(int i = 0 ; i < gm->waves[gm->wave_id].zombies[z_type] ; i++)
            {

                GameManager_GeneratePositionOutsideOfScreen(&randX, &randY);
                Vector_Push(&world->monsters_vector,
                            CreateZombie(   z_type,
                                            randX + world->player.playerC->cameraX,
                                            randY + world->player.playerC->cameraY

                                        )
                            );
            }
        }

        gm->wave_id += 1;

    }
}
Exemplo n.º 2
0
void Scene_Play::Update(Game* _game)
{	
	Player::Instance()->Update();
	m_hiphop1.Update();
	m_hiphop2.Update();
	m_hiphop3.Update();
	m_razer.update(500);
	m_leftHand.Update();
	m_rightHand.Update();
	
	DecreaseHpGage();
	StageStart();
	ChangeMusic();
	UI_Music_Check();
	Effect();

	if (m_screenDoor.GetCurrentFrame() != m_screenDoor.GetFrame())
	{
		m_screenDoor.update(200);
	}

	CreateZombie();

	for (int index = 0; index < m_currentZombie; ++index)
	{
		if (m_pzombie[index] == NULL)
			continue;

		m_pzombie[index]->Update();

		if (m_pzombie[index]->IsDeath())
		{
			_game->AddScore(m_pzombie[index]->GetScore());
			SAFE_DELETE(m_pzombie[index]);
			--m_currentZombie;
			++m_nKillZombie;
		}
	}

	_game->AddScore(m_currentStage);

	if (Player::Instance()->GetDeath())
		_game->ChangeScene(new Scene_Score());
	
}
Exemplo n.º 3
0
Entity* Entity_Create(Main_Category cat, int type, float x, float y, float angle, World* world)
{
    Entity* entity;
    switch(cat)
    {
    case Cat_Wall:
        entity = Wall_Create(type, x, y, world);
        break;
    case Cat_Door:
        entity = Door_Create(type, x, y);
        break;
    case Cat_Ground:
        entity = Ground_Create(type, x, y);
        break;
    case Cat_Zombie:
        entity = CreateZombie(type, x, y);
        break;
    case Cat_Event:
        entity = MapEvent_Create(type, x, y);
        break;
    case Cat_Bonus:
        entity = Bonus_Create(type, x, y, angle);
        break;
    case Cat_Decal:
        entity = Decal_Create(type, x, y, angle);
        break;
    case Cat_Prop:
        entity = Prop_Create(type, x, y, angle);
        break;
    }

    if(angle != 0)
    {
        entity->angle = angle;
    }

    return entity;
}