- [NEW] Anbernics en el lloc i ja se poden recollir

- [CHG] Canviats uns pixels en les portes
- [NEW] Sequencia de final de joc acabada
- [NEW] Al pillar un booster fa sorollet
- Treballant en el prólogo
This commit is contained in:
2024-10-07 13:35:01 +02:00
parent f38d50e7f9
commit fa97ea79e8
30 changed files with 411 additions and 61 deletions

View File

@@ -13,16 +13,18 @@ namespace modules
{
namespace ingame
{
draw::surface *surf;
//draw::surface *surf;
int selected_option = INGAME_CONTINUAR;
actor::actor_t *parts[6] = {nullptr,nullptr,nullptr,nullptr,nullptr,nullptr};
actor::actor_t *anbernic = nullptr;
int num_anbernics = 0;
void init()
{
num_anbernics = actor::hero::getNumAmbernicsCollected();
selected_option = INGAME_CONTINUAR;
surf = draw::getSurface("objectes.gif");
//surf = draw::getSurface("objectes.gif");
if (parts[0]==nullptr)
{
parts[0] = actor::createFromTemplate("P-ELBOW");
@@ -65,6 +67,13 @@ namespace modules
parts[5]->inner_x=96+16;
parts[5]->inner_y=69+8;
}
if (anbernic==nullptr)
{
anbernic = actor::createFromTemplate("ANBERNIC");
anbernic->flags=0;
anbernic->inner_x=252;
anbernic->inner_y=76;
}
}
int loop()
@@ -85,20 +94,33 @@ namespace modules
if (controller::pressed(KEY_JUMP) || controller::pressed(KEY_PICK) || input::keyPressed(SDL_SCANCODE_RETURN))
{
audio::playSound("snd_push.wav", SOUND_BASIC);
if (selected_option==INGAME_EIXIR)
{
for (int i=0; i<6; ++i) { actor::remove(parts[i]); parts[i]=nullptr;}
actor::remove(anbernic); anbernic=nullptr;
}
return selected_option;
}
draw::cls(2);
draw::color(1);
draw::setSource(surf);
//draw::setSource(surf);
static int part[6] = { PART_ELBOW, PART_PIPE, PART_SALT, PART_FILTER, PART_PUMP, PART_TIMER};
for (int i=0;i<6;++i)
{
draw::swapcol(1, room::getColor((actor::hero::getParts() & part[i])?1:3));
actor::drawAt(parts[i], parts[i]->inner_x, parts[i]->inner_y);
}
if (num_anbernics>0)
{
draw::restorecol(1);
actor::drawAt(anbernic, anbernic->inner_x, anbernic->inner_y);
char count[] = " 0/10";
count[1] = (num_anbernics%10)+48;
if (num_anbernics==10) count[0]='1';
draw::print2(count, 30, 12, WHITE, FONT_ZOOM_NONE);
}
draw::print2("PAUSA", 17, 3, TEAL, FONT_ZOOM_VERTICAL);