Stone_Development/gamecube.h
2025-12-15 10:47:32 +01:00

42 lines
948 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include "gamematrix.h"
#include "raylib.h"
#include <rlgl.h>
struct Vec3
{
float x, y, z;
};
class gamecube
{
public:
gamecube(const Vec3 &pos, Color col);
void Update(float flipSpeed);
void FlipForward();
void FlipBackward();
bool IsFlipped() const;
bool IsMatched() const;
void SetMatched(bool m);
void Draw() const;
Vec3 GetPosition() const;
float GetRotationY() const;
Color GetColor() const { return color; }
private:
Vec3 position;
Color color;
bool flipped = false;
bool matched = false;
bool flippingForward = false;
bool flippingBackward = false;
float rotation = 0.0f;
};
enum class GameState
{
Idle, // kein Würfel offen, Eingabe erlaubt
OneFlipped, // ein Würfel offen
CheckingMatch, // zwei Würfel vollständig aufgeklappt, Vergleich läuft
LockInput // Würfel drehen gerade Eingabe kurz blockiert
};