Compare commits
2 Commits
main
...
d9a3dce5dd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9a3dce5dd | ||
|
|
451dcab152 |
1
.vscode/launch.json
vendored
1
.vscode/launch.json
vendored
@@ -4,7 +4,6 @@
|
|||||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
|
|
||||||
{
|
{
|
||||||
"name": "Debug",
|
"name": "Debug",
|
||||||
"type": "cppdbg",
|
"type": "cppdbg",
|
||||||
|
|||||||
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -7,6 +7,5 @@
|
|||||||
"**/.DS_Store": true,
|
"**/.DS_Store": true,
|
||||||
"**/*.o": true,
|
"**/*.o": true,
|
||||||
"**/*.exe": true,
|
"**/*.exe": true,
|
||||||
},
|
}
|
||||||
"cmake.sourceDirectory": "/home/mrsh/Games/test-text/build/external/raylib-master"
|
|
||||||
}
|
}
|
||||||
BIN
raw/mrsh.ase
BIN
raw/mrsh.ase
Binary file not shown.
@@ -1,24 +0,0 @@
|
|||||||
{ "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
BIN
raw/mrsh.png
Binary file not shown.
|
Before Width: | Height: | Size: 206 B |
26
raylib.make
26
raylib.make
@@ -44,54 +44,54 @@ endef
|
|||||||
|
|
||||||
ifeq ($(config),debug_x64)
|
ifeq ($(config),debug_x64)
|
||||||
TARGETDIR = bin/Debug
|
TARGETDIR = bin/Debug
|
||||||
TARGET = $(TARGETDIR)/libraylib.a
|
TARGET = $(TARGETDIR)/raylib.lib
|
||||||
OBJDIR = obj/x64/Debug/raylib
|
OBJDIR = obj/x64/Debug/raylib
|
||||||
DEFINES += -DDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -D_GLFW_X11
|
DEFINES += -DDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33
|
||||||
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g
|
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g
|
||||||
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g
|
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g
|
||||||
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64
|
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64
|
||||||
|
|
||||||
else ifeq ($(config),debug_x86)
|
else ifeq ($(config),debug_x86)
|
||||||
TARGETDIR = bin/Debug
|
TARGETDIR = bin/Debug
|
||||||
TARGET = $(TARGETDIR)/libraylib.a
|
TARGET = $(TARGETDIR)/raylib.lib
|
||||||
OBJDIR = obj/x86/Debug/raylib
|
OBJDIR = obj/x86/Debug/raylib
|
||||||
DEFINES += -DDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -D_GLFW_X11
|
DEFINES += -DDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33
|
||||||
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -g
|
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -g
|
||||||
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -g
|
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -g
|
||||||
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib32 -m32
|
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib32 -m32
|
||||||
|
|
||||||
else ifeq ($(config),debug_arm64)
|
else ifeq ($(config),debug_arm64)
|
||||||
TARGETDIR = bin/Debug
|
TARGETDIR = bin/Debug
|
||||||
TARGET = $(TARGETDIR)/libraylib.a
|
TARGET = $(TARGETDIR)/raylib.lib
|
||||||
OBJDIR = obj/ARM64/Debug/raylib
|
OBJDIR = obj/ARM64/Debug/raylib
|
||||||
DEFINES += -DDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -D_GLFW_X11
|
DEFINES += -DDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33
|
||||||
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g
|
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g
|
||||||
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g
|
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g
|
||||||
ALL_LDFLAGS += $(LDFLAGS)
|
ALL_LDFLAGS += $(LDFLAGS)
|
||||||
|
|
||||||
else ifeq ($(config),release_x64)
|
else ifeq ($(config),release_x64)
|
||||||
TARGETDIR = bin/Release
|
TARGETDIR = bin/Release
|
||||||
TARGET = $(TARGETDIR)/libraylib.a
|
TARGET = $(TARGETDIR)/raylib.lib
|
||||||
OBJDIR = obj/x64/Release/raylib
|
OBJDIR = obj/x64/Release/raylib
|
||||||
DEFINES += -DNDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -D_GLFW_X11
|
DEFINES += -DNDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33
|
||||||
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O2
|
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O2
|
||||||
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O2
|
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O2
|
||||||
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -s
|
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -s
|
||||||
|
|
||||||
else ifeq ($(config),release_x86)
|
else ifeq ($(config),release_x86)
|
||||||
TARGETDIR = bin/Release
|
TARGETDIR = bin/Release
|
||||||
TARGET = $(TARGETDIR)/libraylib.a
|
TARGET = $(TARGETDIR)/raylib.lib
|
||||||
OBJDIR = obj/x86/Release/raylib
|
OBJDIR = obj/x86/Release/raylib
|
||||||
DEFINES += -DNDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -D_GLFW_X11
|
DEFINES += -DNDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33
|
||||||
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -O2
|
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -O2
|
||||||
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -O2
|
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -O2
|
||||||
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib32 -m32 -s
|
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib32 -m32 -s
|
||||||
|
|
||||||
else ifeq ($(config),release_arm64)
|
else ifeq ($(config),release_arm64)
|
||||||
TARGETDIR = bin/Release
|
TARGETDIR = bin/Release
|
||||||
TARGET = $(TARGETDIR)/libraylib.a
|
TARGET = $(TARGETDIR)/raylib.lib
|
||||||
OBJDIR = obj/ARM64/Release/raylib
|
OBJDIR = obj/ARM64/Release/raylib
|
||||||
DEFINES += -DNDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -D_GLFW_X11
|
DEFINES += -DNDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33
|
||||||
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O2
|
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O2
|
||||||
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -O2
|
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -O2
|
||||||
ALL_LDFLAGS += $(LDFLAGS) -s
|
ALL_LDFLAGS += $(LDFLAGS) -s
|
||||||
@@ -159,7 +159,7 @@ ifeq (posix,$(SHELLTYPE))
|
|||||||
$(SILENT) rm -rf $(OBJDIR)
|
$(SILENT) rm -rf $(OBJDIR)
|
||||||
else
|
else
|
||||||
$(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET))
|
$(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET))
|
||||||
$(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED))
|
$(SILENT) $(foreach f,$(subst /,\\,$(GENERATED)),if exist $(f) del /s /q $(f) >nul &)
|
||||||
$(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR))
|
$(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 206 B |
49
src/main.c
49
src/main.c
@@ -10,18 +10,6 @@ by Jeffery Myers is marked with CC0 1.0. To view a copy of this license, visit h
|
|||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
#include "resource_dir.h" // utility header for SearchAndSetResourceDir
|
#include "resource_dir.h" // utility header for SearchAndSetResourceDir
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
typedef struct Player {
|
|
||||||
Vector2 position;
|
|
||||||
Vector2 size;
|
|
||||||
int life;
|
|
||||||
} Player;
|
|
||||||
|
|
||||||
static Player player = {0};
|
|
||||||
|
|
||||||
static void characterMovement(void);
|
|
||||||
|
|
||||||
|
|
||||||
int main ()
|
int main ()
|
||||||
{
|
{
|
||||||
@@ -35,12 +23,11 @@ int main ()
|
|||||||
SearchAndSetResourceDir("resources");
|
SearchAndSetResourceDir("resources");
|
||||||
|
|
||||||
// Load a texture from the resources directory
|
// Load a texture from the resources directory
|
||||||
Image image = LoadImage("mrsh.png");
|
Image image = LoadImage("emi.png");
|
||||||
Texture2D emi = LoadTextureFromImage(image);
|
Texture2D emi = LoadTextureFromImage(image);
|
||||||
UnloadImage(image);
|
UnloadImage(image);
|
||||||
|
|
||||||
int HorizontalPosition = 400;
|
|
||||||
int VerticalPosition = 300;
|
|
||||||
|
|
||||||
// game loop
|
// game loop
|
||||||
while (!WindowShouldClose()) // run the loop until the user presses ESCAPE or presses the Close button on the window
|
while (!WindowShouldClose()) // run the loop until the user presses ESCAPE or presses the Close button on the window
|
||||||
@@ -51,12 +38,14 @@ int main ()
|
|||||||
// Setup the back buffer for drawing (clear color and depth buffers)
|
// Setup the back buffer for drawing (clear color and depth buffers)
|
||||||
ClearBackground(BLACK);
|
ClearBackground(BLACK);
|
||||||
|
|
||||||
// DrawRectangle(HorizontalPosition, VerticalPosition, 10, 10, BLUE);
|
// draw our texture to the screen
|
||||||
DrawTexture(emi, player.position.x, player.position.y, WHITE);
|
DrawTexture(emi, 800/2 - emi.width/2, 600/2 - emi.height/2, WHITE);
|
||||||
|
|
||||||
characterMovement();
|
// draw some text using the default font
|
||||||
|
DrawText("Emi la plus belle", 200,50,20,PINK);
|
||||||
|
|
||||||
|
|
||||||
|
// end the frame and get ready for the next one (display frame, poll input, etc...)
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,27 +57,3 @@ int main ()
|
|||||||
CloseWindow();
|
CloseWindow();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
void characterMovement(void){
|
|
||||||
|
|
||||||
//up
|
|
||||||
if (IsKeyDown(74) ) {
|
|
||||||
// draw some text using the default font
|
|
||||||
player.position.y = player.position.y+10;
|
|
||||||
};
|
|
||||||
//down
|
|
||||||
if (IsKeyDown(75) ) {
|
|
||||||
player.position.y = player.position.y-10;
|
|
||||||
// draw some text using the default font
|
|
||||||
};
|
|
||||||
//left
|
|
||||||
if (IsKeyDown(72) ) {
|
|
||||||
player.position.x = player.position.x-10;
|
|
||||||
// draw some text using the default font
|
|
||||||
};
|
|
||||||
//right
|
|
||||||
if (IsKeyDown(76)) {
|
|
||||||
player.position.x = player.position.x+10;
|
|
||||||
// draw some text using the default font
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user