Add mrsh sprite #4

Merged
Emiette merged 4 commits from feature/add-mrsh-sprite into main 2026-04-21 11:05:07 +00:00
6 changed files with 84 additions and 19 deletions

BIN
raw/mrsh.ase Normal file

Binary file not shown.

24
raw/mrsh.json Normal file
View File

@@ -0,0 +1,24 @@
{ "frames": {
"mrsh.ase": {
"frame": { "x": 0, "y": 0, "w": 16, "h": 16 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 16, "h": 16 },
"sourceSize": { "w": 16, "h": 16 },
"duration": 100
}
},
"meta": {
"app": "https://github.com/LibreSprite/LibreSprite/",
"version": "1.2-973d0e3d-SDL",
"image": "C:\\Code\\test-game\\raw\\mrsh.png",
"format": "RGBA8888",
"size": { "w": 16, "h": 16 },
"scale": "1",
"frameTags": [
],
"layers": [
{ "name": "Layer 1", "opacity": 255, "blendMode": "normal" }
]
}
}

BIN
raw/mrsh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

View File

@@ -44,54 +44,54 @@ endef
ifeq ($(config),debug_x64)
TARGETDIR = bin/Debug
TARGET = $(TARGETDIR)/raylib.lib
TARGET = $(TARGETDIR)/libraylib.a
OBJDIR = obj/x64/Debug/raylib
DEFINES += -DDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33
DEFINES += -DDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -D_GLFW_X11
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64
else ifeq ($(config),debug_x86)
TARGETDIR = bin/Debug
TARGET = $(TARGETDIR)/raylib.lib
TARGET = $(TARGETDIR)/libraylib.a
OBJDIR = obj/x86/Debug/raylib
DEFINES += -DDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33
DEFINES += -DDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -D_GLFW_X11
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -g
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -g
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib32 -m32
else ifeq ($(config),debug_arm64)
TARGETDIR = bin/Debug
TARGET = $(TARGETDIR)/raylib.lib
TARGET = $(TARGETDIR)/libraylib.a
OBJDIR = obj/ARM64/Debug/raylib
DEFINES += -DDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33
DEFINES += -DDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -D_GLFW_X11
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g
ALL_LDFLAGS += $(LDFLAGS)
else ifeq ($(config),release_x64)
TARGETDIR = bin/Release
TARGET = $(TARGETDIR)/raylib.lib
TARGET = $(TARGETDIR)/libraylib.a
OBJDIR = obj/x64/Release/raylib
DEFINES += -DNDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33
DEFINES += -DNDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -D_GLFW_X11
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O2
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O2
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -s
else ifeq ($(config),release_x86)
TARGETDIR = bin/Release
TARGET = $(TARGETDIR)/raylib.lib
TARGET = $(TARGETDIR)/libraylib.a
OBJDIR = obj/x86/Release/raylib
DEFINES += -DNDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33
DEFINES += -DNDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -D_GLFW_X11
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -O2
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -O2
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib32 -m32 -s
else ifeq ($(config),release_arm64)
TARGETDIR = bin/Release
TARGET = $(TARGETDIR)/raylib.lib
TARGET = $(TARGETDIR)/libraylib.a
OBJDIR = obj/ARM64/Release/raylib
DEFINES += -DNDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33
DEFINES += -DNDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -D_GLFW_X11
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O2
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -O2
ALL_LDFLAGS += $(LDFLAGS) -s
@@ -159,7 +159,7 @@ ifeq (posix,$(SHELLTYPE))
$(SILENT) rm -rf $(OBJDIR)
else
$(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET))
$(SILENT) $(foreach f,$(subst /,\\,$(GENERATED)),if exist $(f) del /s /q $(f) >nul &)
$(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED))
$(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR))
endif

BIN
resources/mrsh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

View File

@@ -12,6 +12,16 @@ by Jeffery Myers is marked with CC0 1.0. To view a copy of this license, visit h
#include "resource_dir.h" // utility header for SearchAndSetResourceDir
#include <stdlib.h>
//------------------------------------------------------------------------------------
// Module Functions Declaration (local)
//------------------------------------------------------------------------------------
static void InitGame(void); // Initialize game
static void UpdateGame(void); // Update game (one frame)
static void DrawGame(void); // Draw game (one frame)
static void UnloadGame(void); // Unload game
static void UpdateDrawFrame(void); // Update and Draw (one frame)
int main ()
{
// Tell the window to use vsync and work on high DPI displays
@@ -24,7 +34,7 @@ int main ()
SearchAndSetResourceDir("resources");
// Load a texture from the resources directory
Image image = LoadImage("emi.png");
Image image = LoadImage("mrsh.png");
Texture2D emi = LoadTextureFromImage(image);
UnloadImage(image);
@@ -38,6 +48,9 @@ int main ()
int positionXCollectible = GetRandomValue(0, 600);
int positionYCollectible = GetRandomValue(0, 800);
// Character controller settings
int speed = 2;
// game loop
while (!WindowShouldClose()) // run the loop until the user presses ESCAPE or presses the Close button on the window
@@ -48,7 +61,9 @@ int main ()
// Setup the back buffer for drawing (clear color and depth buffers)
ClearBackground(BLACK);
DrawRectangle(HorizontalPosition, VerticalPosition, 10, 10, BLUE);
// DrawRectangle(HorizontalPosition, VerticalPosition, 10, 10, BLUE);
DrawTexture(emi, HorizontalPosition, VerticalPosition, WHITE);
DrawCircle(positionXCollectible, positionYCollectible, 10, YELLOW);
@@ -66,21 +81,21 @@ int main ()
//up
if (IsKeyDown(74) && VerticalPosition != 580 ) {
// draw some text using the default font
VerticalPosition = VerticalPosition+10;
VerticalPosition = VerticalPosition+speed;
};
//down
if (IsKeyDown(75) && VerticalPosition != 0) {
VerticalPosition = VerticalPosition-10;
VerticalPosition = VerticalPosition-speed;
// draw some text using the default font
};
//left
if (IsKeyDown(72) && HorizontalPosition != 0) {
HorizontalPosition = HorizontalPosition-10;
HorizontalPosition = HorizontalPosition-speed;
// draw some text using the default font
};
//right
if (IsKeyDown(76)&& HorizontalPosition != 780) {
HorizontalPosition = HorizontalPosition+10;
HorizontalPosition = HorizontalPosition+speed;
// draw some text using the default font
};
@@ -105,3 +120,29 @@ int main ()
CloseWindow();
return 0;
}
void InitGame(void)
{
return;
}
void UpdateGame(void)
{
return;
}
void DrawGame(void)
{
return;
}
void UnloadGame(void)
{
return;
}
void UpdateDrawFrame(void)
{
UpdateGame();
DrawGame();
}