jumpartifact.com_demo_0/src/screen_trunner.h

58 lines
1.1 KiB
C
Raw Normal View History

#ifndef JUMPARTIFACT_DOT_COM_DEMO_0_TANK_RUNNER_H_
#define JUMPARTIFACT_DOT_COM_DEMO_0_TANK_RUNNER_H_
#include "screen.h"
// standard library includes
#include <array>
#include <bitset>
// third party includes
#include <raylib.h>
2023-08-07 03:54:23 +00:00
constexpr float POS_VALUE_INC_RATE = 0.5F;
constexpr float CAMERA_UPDATE_RATE = 1.0F;
class TRunnerScreen : public Screen {
public:
TRunnerScreen(std::weak_ptr<ScreenStack> stack);
~TRunnerScreen() override;
bool update(float dt) override;
bool draw() override;
private:
enum Pixel : unsigned char {
PIXEL_BLANK,
PIXEL_BLACK,
PIXEL_RED,
PIXEL_GREEN,
PIXEL_BLUE,
PIXEL_YELLOW,
PIXEL_CYAN,
PIXEL_MAGENTA,
PIXEL_ORANGE,
PIXEL_BROWN,
PIXEL_TURQUOISE,
PIXEL_SKY,
PIXEL_WHITE
};
static Color PixelToColor(Pixel p);
2023-08-07 03:54:23 +00:00
Camera3D camera;
std::bitset<64> flags;
2023-08-07 03:54:23 +00:00
Material default_material;
2023-08-04 05:32:05 +00:00
Model TEMP_cube_model;
2023-08-07 03:54:23 +00:00
Mesh plane_mesh;
2023-08-04 05:32:05 +00:00
Texture2D TEMP_cube_texture;
Matrix TEMP_matrix;
2023-08-07 03:54:23 +00:00
Vector3 camera_pos;
Vector3 camera_target;
float pos_value;
void camera_to_targets(float dt);
};
#endif