Persistent storage management

i wanted to make a inventory for the player in my game (hopefully il post it here soon :D) and i got stuck on how to save things to data files i made (coped most of it from the starter example ) this

#include "raylib.h"
typedef enum { STORAGE_SCORE=5, STORAGE_HISCORE } StorageData;
int main()
{


int screenWidth = 800;
int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
int score=STORAGE_SCORE;
SetTargetFPS(60);

while (!WindowShouldClose())
{

BeginDrawing();
StorageSaveValue(STORAGE_SCORE, score);
ClearBackground(RAYWHITE);
DrawText(FormatText("score: %i", score), 160, 200, 50, RED); //text

EndDrawing();

}


CloseWindow();

return 0;
}


problem is if i remove the "=5" from "typedef enum { STORAGE_SCORE=5, STORAGE_HISCORE } StorageData;"
the STORAGE_SCORE will be rested to 0

what im i doing wrong?
thank you for the help in advance and sorry for my bad English D:

Comments

Sign In or Register to comment.