allow to skip intro with start button

This commit is contained in:
hackgrid 2023-11-04 11:26:18 +01:00 committed by GitHub
parent 32bd9a62af
commit 81ae9a5608
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,6 +8,7 @@
#include "../util/rom.h"
#include "../graphics/image.h"
#include "../build/assets/materials/images.h"
#include "../controls/controller.h"
#define INTRO_TIME 9.0f
@ -32,7 +33,7 @@ void introInit(struct Intro* intro) {
void introUpdate(struct Intro* intro) {
intro->time += FIXED_DELTA_TIME;
if (intro->time > INTRO_TIME) {
if (intro->time > INTRO_TIME || controllerGetButtonDown(0, START_BUTTON)) {
levelQueueLoad(MAIN_MENU, NULL, NULL);
}
}
@ -66,4 +67,4 @@ void introRender(void* data, struct RenderState* renderState, struct GraphicsTas
VALVE_IMAGE_WIDTH, VALVE_IMAGE_HEIGHT,
fadeColor
);
}
}