2018-08-09 11:35:52 +02:00
|
|
|
//
|
|
|
|
// Created by Wouter Groeneveld on 09/08/18.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef GBA_SPRITE_ENGINE_PROJECT_FOOD_SCENE_H
|
|
|
|
#define GBA_SPRITE_ENGINE_PROJECT_FOOD_SCENE_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <libgba-sprite-engine/scene.h>
|
|
|
|
#include <libgba-sprite-engine/sprites/sprite_builder.h>
|
|
|
|
#include <libgba-sprite-engine/sprites/affine_sprite.h>
|
2018-08-09 18:11:18 +02:00
|
|
|
#include "bullet.h"
|
2018-08-09 11:35:52 +02:00
|
|
|
|
|
|
|
class FoodScene : public Scene {
|
|
|
|
private:
|
2018-12-18 16:23:08 +01:00
|
|
|
int counter = 0;
|
2018-08-09 11:35:52 +02:00
|
|
|
std::unique_ptr<AffineSprite> avatar;
|
2018-08-09 18:11:18 +02:00
|
|
|
std::unique_ptr<Sprite> someBulletSprite;
|
|
|
|
std::vector<std::unique_ptr<Bullet>> bullets;
|
2018-08-09 11:35:52 +02:00
|
|
|
int avatarRotation;
|
2018-08-09 12:35:05 +02:00
|
|
|
u32 bulletCooldown;
|
2018-08-09 11:35:52 +02:00
|
|
|
|
|
|
|
std::unique_ptr<SpriteBuilder<Sprite>> spriteBuilder;
|
2018-08-09 18:11:18 +02:00
|
|
|
std::unique_ptr<Bullet> createBullet();
|
2018-08-09 11:35:52 +02:00
|
|
|
void removeBulletsOffScreen();
|
|
|
|
|
2018-12-14 13:11:13 +01:00
|
|
|
VECTOR rotateAround(VECTOR center, VECTOR point);
|
|
|
|
VECTOR defaultBulletTarget;
|
|
|
|
|
2018-08-09 11:35:52 +02:00
|
|
|
public:
|
|
|
|
explicit FoodScene(const std::shared_ptr<GBAEngine> &engine);
|
|
|
|
FoodScene(FoodScene& other) = delete;
|
|
|
|
|
|
|
|
std::vector<Sprite *> sprites() override;
|
|
|
|
std::vector<Background *> backgrounds() override;
|
|
|
|
|
|
|
|
void load() override;
|
|
|
|
void tick(u16 keys) override;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif //GBA_SPRITE_ENGINE_PROJECT_FOOD_SCENE_H
|