The challenge in this video stuck me over stupid stuff.
At this point, I’m getting even basic syntax screwed up because I cant keep this stuff straight in my head.
Prop.h
#include "raylib.h"
class Prop
{
public:
Prop(Vector2 Pos,
Texture2D Tex);
void Render(Vector2 KnightPos);
private:
Texture2D Texture{};
Vector2 WorldPos{};
Vector2 ScreenPos{};
float Scale{4.f};
};
Prop.cpp
#include "Prop.h"
#include "raylib.h"
#include "raymath.h"
Prop::Prop(Vector2 Pos, Texture2D Tex) : WorldPos(Pos),
Texture(Tex)
{
{
void Render(Vector2 KnightPos)
ScreenPos = Vector2Subtract(WorldPos, KnightPos);
DrawTextureEx(Tex);
}
};
We’ve got three different files talking to each other. He’s making stuff in one, saying how it works in another, and actually using the thing in a third. This is confusing and frustrating, how do you keep it sorted what goes where, let alone the arcane details that must be observed when writing it? Is it maybe because he’s lightened up on the strong metaphors and jokes that the class began with or am I just tired?
Further, after following along with the answer I’m able to get a good result but I still get these warnings.
Finally, it occurs to me that previously he made it sound like a big deal that we UnloadTexture() for all images we use but it seems we did no such thing with rock.