- [FIX] No es podia entrar al editor de bitmap_pos des de l'editor
- [FIX] Recreativa afegida - [NEW] Prologo acabat - [FIX] Quan s'acava el boost de invulnerabilitat se moria
This commit is contained in:
72
source/m_end_prologo_sequence.cpp
Normal file
72
source/m_end_prologo_sequence.cpp
Normal file
@@ -0,0 +1,72 @@
|
||||
#include "m_intro.h"
|
||||
#include "jgame.h"
|
||||
#include "jdraw.h"
|
||||
#include "jinput.h"
|
||||
#include "jaudio.h"
|
||||
#include "controller.h"
|
||||
#include "config.h"
|
||||
#include <SDL2/SDL.h>
|
||||
#include "actor.h"
|
||||
|
||||
namespace modules
|
||||
{
|
||||
namespace end_prologo_sequence
|
||||
{
|
||||
int stage = 0;
|
||||
uint32_t time = 0;
|
||||
|
||||
void init()
|
||||
{
|
||||
time = SDL_GetTicks();
|
||||
stage = 0;
|
||||
draw::restorecol(2);
|
||||
draw::cls(2);
|
||||
|
||||
draw::swapcol(1, 7);
|
||||
draw::setSource(draw::getSurface("prologo3.gif"));
|
||||
draw::draw(96, 28, 128, 96, 0, 0);
|
||||
draw::print2("ALE! QUE BON", 13, 17, WHITE, FONT_ZOOM_NONE);
|
||||
draw::print2("TRABAJ HE HECH!", 11, 19, WHITE, FONT_ZOOM_NONE);
|
||||
draw::render();
|
||||
|
||||
if (audio::getCurrentMusic() != "mus_menu.ogg") audio::playMusic("mus_menu.ogg");
|
||||
actor::templates::load();
|
||||
}
|
||||
|
||||
const bool shouldGoToNext()
|
||||
{
|
||||
if (SDL_GetTicks()-time < 1000) return false;
|
||||
return (SDL_GetTicks()-time > (stage==15||stage==16?10000:5000)) ||
|
||||
(controller::pressed(KEY_JUMP)) || (controller::pressed(KEY_PICK)) ||
|
||||
(input::keyPressed(SDL_SCANCODE_SPACE)) || (input::keyPressed(SDL_SCANCODE_RETURN));
|
||||
}
|
||||
|
||||
bool loop()
|
||||
{
|
||||
if (controller::pressed(KEY_MENU)) return false;
|
||||
|
||||
if (shouldGoToNext())
|
||||
{
|
||||
time = SDL_GetTicks();
|
||||
stage++;
|
||||
if (stage==2) return false;
|
||||
|
||||
switch (stage)
|
||||
{
|
||||
case 1:
|
||||
draw::cls(2);
|
||||
draw::swapcol(1, 8);
|
||||
draw::setSource(draw::getSurface("prologo4.gif"));
|
||||
draw::draw(96, 28, 128, 96, 0, 0);
|
||||
draw::print2("PERO QUE...?", 12, 17, WHITE, FONT_ZOOM_NONE);
|
||||
//draw::render();
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
draw::render();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user