Compare commits
3 Commits
962e15debc
...
12ecf5453c
| Author | SHA1 | Date | |
|---|---|---|---|
| 12ecf5453c | |||
|
|
d9a3dce5dd | ||
|
|
451dcab152 |
8
.gitignore
vendored
8
.gitignore
vendored
@@ -405,4 +405,12 @@ Makefile
|
||||
*.swp
|
||||
*.swo
|
||||
*.swn
|
||||
|
||||
/build/compile_commands.json
|
||||
raylib.make
|
||||
raylib.vcxproj
|
||||
raylib.vcxproj.filters
|
||||
test-game.make
|
||||
test-game.vcxproj
|
||||
test-game.vcxproj.filters
|
||||
raylib.make
|
||||
|
||||
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
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
|
||||
{
|
||||
"name": "Debug",
|
||||
"type": "cppdbg",
|
||||
|
||||
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -7,6 +7,5 @@
|
||||
"**/.DS_Store": true,
|
||||
"**/*.o": true,
|
||||
"**/*.exe": true,
|
||||
},
|
||||
"cmake.sourceDirectory": "/home/mrsh/Games/test-text/build/external/raylib-master"
|
||||
}
|
||||
}
|
||||
26
raylib.make
26
raylib.make
@@ -44,54 +44,54 @@ endef
|
||||
|
||||
ifeq ($(config),debug_x64)
|
||||
TARGETDIR = bin/Debug
|
||||
TARGET = $(TARGETDIR)/libraylib.a
|
||||
TARGET = $(TARGETDIR)/raylib.lib
|
||||
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_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g
|
||||
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64
|
||||
|
||||
else ifeq ($(config),debug_x86)
|
||||
TARGETDIR = bin/Debug
|
||||
TARGET = $(TARGETDIR)/libraylib.a
|
||||
TARGET = $(TARGETDIR)/raylib.lib
|
||||
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_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -g
|
||||
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib32 -m32
|
||||
|
||||
else ifeq ($(config),debug_arm64)
|
||||
TARGETDIR = bin/Debug
|
||||
TARGET = $(TARGETDIR)/libraylib.a
|
||||
TARGET = $(TARGETDIR)/raylib.lib
|
||||
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_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g
|
||||
ALL_LDFLAGS += $(LDFLAGS)
|
||||
|
||||
else ifeq ($(config),release_x64)
|
||||
TARGETDIR = bin/Release
|
||||
TARGET = $(TARGETDIR)/libraylib.a
|
||||
TARGET = $(TARGETDIR)/raylib.lib
|
||||
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_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O2
|
||||
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -s
|
||||
|
||||
else ifeq ($(config),release_x86)
|
||||
TARGETDIR = bin/Release
|
||||
TARGET = $(TARGETDIR)/libraylib.a
|
||||
TARGET = $(TARGETDIR)/raylib.lib
|
||||
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_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -O2
|
||||
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib32 -m32 -s
|
||||
|
||||
else ifeq ($(config),release_arm64)
|
||||
TARGETDIR = bin/Release
|
||||
TARGET = $(TARGETDIR)/libraylib.a
|
||||
TARGET = $(TARGETDIR)/raylib.lib
|
||||
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_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) 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))
|
||||
endif
|
||||
|
||||
|
||||
51
src/main.c
51
src/main.c
@@ -10,7 +10,6 @@ by Jeffery Myers is marked with CC0 1.0. To view a copy of this license, visit h
|
||||
#include "raylib.h"
|
||||
|
||||
#include "resource_dir.h" // utility header for SearchAndSetResourceDir
|
||||
#include <stdlib.h>
|
||||
|
||||
int main ()
|
||||
{
|
||||
@@ -28,15 +27,6 @@ int main ()
|
||||
Texture2D emi = LoadTextureFromImage(image);
|
||||
UnloadImage(image);
|
||||
|
||||
int HorizontalPosition = 400;
|
||||
int VerticalPosition = 300;
|
||||
|
||||
int point = 0;
|
||||
|
||||
//Start point of the colectible
|
||||
|
||||
int positionXCollectible = GetRandomValue(0, 600);
|
||||
int positionYCollectible = GetRandomValue(0, 800);
|
||||
|
||||
|
||||
// game loop
|
||||
@@ -48,45 +38,12 @@ int main ()
|
||||
// Setup the back buffer for drawing (clear color and depth buffers)
|
||||
ClearBackground(BLACK);
|
||||
|
||||
DrawCircle(HorizontalPosition, VerticalPosition, 10, BLUE);
|
||||
// draw our texture to the screen
|
||||
DrawTexture(emi, 800/2 - emi.width/2, 600/2 - emi.height/2, WHITE);
|
||||
|
||||
DrawCircle(positionXCollectible, positionYCollectible, 10, YELLOW);
|
||||
// draw some text using the default font
|
||||
DrawText("Emi la plus belle", 200,50,20,PINK);
|
||||
|
||||
//draw score
|
||||
DrawText(TextFormat("score : %d", point), 500,50,20,PINK);
|
||||
|
||||
|
||||
//up
|
||||
if (IsKeyDown(74) && VerticalPosition != 580 ) {
|
||||
// draw some text using the default font
|
||||
VerticalPosition = VerticalPosition+10;
|
||||
};
|
||||
//down
|
||||
if (IsKeyDown(75) && VerticalPosition != 0) {
|
||||
VerticalPosition = VerticalPosition-10;
|
||||
// draw some text using the default font
|
||||
};
|
||||
//left
|
||||
if (IsKeyDown(72) && HorizontalPosition != 0) {
|
||||
HorizontalPosition = HorizontalPosition-10;
|
||||
// draw some text using the default font
|
||||
};
|
||||
//right
|
||||
if (IsKeyDown(76)&& HorizontalPosition != 780) {
|
||||
HorizontalPosition = HorizontalPosition+10;
|
||||
// draw some text using the default font
|
||||
};
|
||||
|
||||
if(point == 10){
|
||||
DrawText("Emi la plus belle", 50,50,20,PINK);
|
||||
}
|
||||
|
||||
if (abs(positionXCollectible - HorizontalPosition) < 10 &&
|
||||
abs(positionYCollectible - VerticalPosition) < 10){
|
||||
positionXCollectible = GetRandomValue(0, 800);
|
||||
positionYCollectible = GetRandomValue(0, 600);
|
||||
point = point + 1;
|
||||
}
|
||||
|
||||
// end the frame and get ready for the next one (display frame, poll input, etc...)
|
||||
EndDrawing();
|
||||
|
||||
Reference in New Issue
Block a user