2018-08-02 16:26:44 +02:00
|
|
|
//
|
|
|
|
// Created by Wouter Groeneveld on 02/08/18.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include <engine/sprites/sprite_builder.h>
|
|
|
|
#include <engine/background/text_stream.h>
|
|
|
|
#include <engine/gba/tonc_memdef.h>
|
2018-08-02 16:45:44 +02:00
|
|
|
#include <engine/gba_engine.h>
|
2018-08-04 10:43:27 +02:00
|
|
|
#include <engine/effects/fade_out_scene.h>
|
2018-08-02 16:26:44 +02:00
|
|
|
#include "sample_start_scene.h"
|
|
|
|
#include "kul.h"
|
2018-08-02 16:45:44 +02:00
|
|
|
#include "flying_stuff_scene.h"
|
2018-08-02 16:26:44 +02:00
|
|
|
|
|
|
|
std::vector<Background *> SampleStartScene::backgrounds() {
|
|
|
|
return {};
|
|
|
|
}
|
|
|
|
|
|
|
|
std::vector<Sprite *> SampleStartScene::sprites() {
|
|
|
|
return { smiley.get(), logo.get() };
|
|
|
|
}
|
|
|
|
|
|
|
|
void SampleStartScene::load() {
|
|
|
|
foregroundPalette = std::unique_ptr<ForegroundPaletteManager>(new ForegroundPaletteManager(sharedPal, sizeof(sharedPal)));
|
|
|
|
|
|
|
|
SpriteBuilder<Sprite> builder;
|
|
|
|
|
|
|
|
smiley = builder
|
|
|
|
.withData(piskelTiles, sizeof(piskelTiles))
|
|
|
|
.withSize(SIZE_16_16)
|
|
|
|
.withLocation(10, 10)
|
|
|
|
.buildPtr();
|
|
|
|
|
|
|
|
logo = builder
|
|
|
|
.withData(kulTiles, sizeof(kulTiles))
|
|
|
|
.withSize(SIZE_64_32)
|
|
|
|
.withLocation(50, 50)
|
|
|
|
.buildPtr();
|
|
|
|
|
|
|
|
TextStream::instance().setText("PRESS START", 3, 8);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SampleStartScene::tick(u16 keys) {
|
|
|
|
if(keys & KEY_START) {
|
|
|
|
TextStream::instance() << "entered: starting next scene";
|
2018-08-02 16:45:44 +02:00
|
|
|
|
2018-08-04 10:43:27 +02:00
|
|
|
engine->transitionIntoScene(new FlyingStuffScene(), new FadeOutScene(2));
|
2018-08-02 16:26:44 +02:00
|
|
|
}
|
|
|
|
}
|