Compare commits

..

No commits in common. '952be11131f3e059f355e79495ea3585b562dfc1' and '5a244e2c387b11b0f46f55dfe84cf7b23db6064a' have entirely different histories.

  1. 3
      .gitmodules
  2. 1
      lib/raylib
  3. 41
      src/Makefile
  4. 0
      src/Makefile.Android
  5. 0
      src/resources/LICENSE
  6. 0
      src/resources/ambient.ogg
  7. 0
      src/resources/coin.wav
  8. 0
      src/resources/mecha.png
  9. 2
      src/screen_title.c

3
.gitmodules vendored

@ -1,3 +0,0 @@
[submodule "lib/raylib"]
path = lib/raylib
url = https://github.com/raysan5/raylib.git

1
lib/raylib

@ -1 +0,0 @@
Subproject commit 47dd842e8163d43587c7f6bb91bbf88dbdbb24b1

41
Makefile → src/Makefile

@ -21,7 +21,7 @@
# #
#************************************************************************************************** #**************************************************************************************************
.PHONY: all clean run .PHONY: all clean
# Define required environment variables # Define required environment variables
#------------------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------------------
@ -29,11 +29,11 @@
PLATFORM ?= PLATFORM_DESKTOP PLATFORM ?= PLATFORM_DESKTOP
# Define project variables # Define project variables
PROJECT_NAME ?= lemonade-stand PROJECT_NAME ?= raylib_game
PROJECT_VERSION ?= 1.0 PROJECT_VERSION ?= 1.0
PROJECT_BUILD_PATH ?= . PROJECT_BUILD_PATH ?= .
RAYLIB_PATH ?= ./lib/raylib RAYLIB_PATH ?= ../../raylib
# Locations of raylib.h and libraylib.a/libraylib.so # Locations of raylib.h and libraylib.a/libraylib.so
# NOTE: Those variables are only used for PLATFORM_OS: LINUX, BSD # NOTE: Those variables are only used for PLATFORM_OS: LINUX, BSD
@ -52,15 +52,11 @@ USE_WAYLAND_DISPLAY ?= FALSE
# PLATFORM_WEB: Default properties # PLATFORM_WEB: Default properties
BUILD_WEB_ASYNCIFY ?= FALSE BUILD_WEB_ASYNCIFY ?= FALSE
BUILD_WEB_SHELL ?= src/minshell.html BUILD_WEB_SHELL ?= minshell.html
BUILD_WEB_HEAP_SIZE ?= 134217728 BUILD_WEB_HEAP_SIZE ?= 134217728
BUILD_WEB_RESOURCES ?= TRUE BUILD_WEB_RESOURCES ?= TRUE
BUILD_WEB_RESOURCES_PATH ?= resources BUILD_WEB_RESOURCES_PATH ?= resources
BUILD_DIR ?= ./build
SRC_DIR ?= ./src
LIB_DIR ?= ./lib
# Use cross-compiler for PLATFORM_RPI # Use cross-compiler for PLATFORM_RPI
ifeq ($(PLATFORM),PLATFORM_RPI) ifeq ($(PLATFORM),PLATFORM_RPI)
USE_RPI_CROSS_COMPILER ?= FALSE USE_RPI_CROSS_COMPILER ?= FALSE
@ -116,7 +112,7 @@ endif
ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),LINUX) ifeq ($(PLATFORM_OS),LINUX)
RAYLIB_PREFIX ?= .. RAYLIB_PREFIX ?= ..
RAYLIB_PATH ?= $(realpath $(RAYLIB_PREFIX)) RAYLIB_PATH = $(realpath $(RAYLIB_PREFIX))
endif endif
endif endif
@ -131,7 +127,6 @@ endif
# Define raylib release directory for compiled library # Define raylib release directory for compiled library
RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src
ifeq ($(OS),Windows_NT)
ifeq ($(PLATFORM),PLATFORM_WEB) ifeq ($(PLATFORM),PLATFORM_WEB)
# Emscripten required variables # Emscripten required variables
EMSDK_PATH ?= C:/emsdk EMSDK_PATH ?= C:/emsdk
@ -141,7 +136,6 @@ ifeq ($(OS),Windows_NT)
NODE_PATH = $(EMSDK_PATH)/node/14.15.5_64bit/bin NODE_PATH = $(EMSDK_PATH)/node/14.15.5_64bit/bin
export PATH = $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH):$$(PATH) export PATH = $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH):$$(PATH)
endif endif
endif
# Define default C compiler: CC # Define default C compiler: CC
#------------------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------------------
@ -234,7 +228,7 @@ endif
# Define include paths for required headers: INCLUDE_PATHS # Define include paths for required headers: INCLUDE_PATHS
# NOTE: Some external/extras libraries could be required (stb, physac, easings...) # NOTE: Some external/extras libraries could be required (stb, physac, easings...)
#------------------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------------------
INCLUDE_PATHS = -I$(SRC_DIR) -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external -I$(RAYLIB_PATH)/src/extras INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external -I$(RAYLIB_PATH)/src/extras
# Define additional directories containing required header files # Define additional directories containing required header files
ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM),PLATFORM_DESKTOP)
@ -256,7 +250,7 @@ endif
# Define library paths containing required libs: LDFLAGS # Define library paths containing required libs: LDFLAGS
#------------------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------------------
LDFLAGS = -L$(SRC) -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS) ifeq ($(PLATFORM_OS),WINDOWS)
@ -387,9 +381,7 @@ PROJECT_SOURCE_FILES ?= \
screen_ending.c screen_ending.c
# Define all object files from source files # Define all object files from source files
OBJS = $(addprefix $(BUILD_DIR)/,$(patsubst %.c, %.o, $(PROJECT_SOURCE_FILES))) OBJS = $(patsubst %.c, %.o, $(PROJECT_SOURCE_FILES))
#
SOURCE_FILES = $(addprefix $(SRC_DIR)/,$(PROJECT_SOURCE_FILES))
# Define processes to execute # Define processes to execute
@ -400,22 +392,21 @@ ifeq ($(PLATFORM),PLATFORM_ANDROID)
export PROJECT_NAME export PROJECT_NAME
export PROJECT_SOURCE_FILES export PROJECT_SOURCE_FILES
else else
MAKEFILE_PARAMS = $(BUILD_DIR)/$(PROJECT_NAME) MAKEFILE_PARAMS = $(PROJECT_NAME)
endif endif
# Default target entry # Default target entry
# NOTE: We call this Makefile target or Makefile.Android target # NOTE: We call this Makefile target or Makefile.Android target
all: all:
$(MAKE) -C $(RAYLIB_PATH)/src $(RAYLIB PLATFORM=$(PLATFORM) -B
$(MAKE) $(MAKEFILE_PARAMS) $(MAKE) $(MAKEFILE_PARAMS)
# Project target defined by PROJECT_NAME # Project target defined by PROJECT_NAME
$(BUILD_DIR)/$(PROJECT_NAME): $(OBJS) $(PROJECT_NAME): $(OBJS)
$(CC) -o $@$(EXT) $(OBJS) $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM) $(CC) -o $(PROJECT_NAME)$(EXT) $(OBJS) $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
# Compile source files # Compile source files
# NOTE: This pattern will compile every module defined on $(OBJS) # NOTE: This pattern will compile every module defined on $(OBJS)
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.c %.o: %.c
$(CC) -c $< -o $@ $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) $(CC) -c $< -o $@ $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM)
# Clean everything # Clean everything
@ -443,11 +434,3 @@ ifeq ($(PLATFORM),PLATFORM_DRM)
endif endif
@echo Cleaning done @echo Cleaning done
run: $(BUILD_DIR)/$(PROJECT_NAME)$(EXT)
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
./$(BUILD_DIR)/$(PROJECT_NAME)
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
npx live-server --open=$(BUILD_DIR)/$(PROJECT_NAME)$(EXT) \
--watch=$(BUILD_DIR)/*.wasm,$(BUILD_DIR)/*.html,$(BUILD_DIR)/*.js,$(BUILD_DIR)/*.data
endif

0
Makefile.Android → src/Makefile.Android

0
resources/LICENSE → src/resources/LICENSE

0
resources/ambient.ogg → src/resources/ambient.ogg

0
resources/coin.wav → src/resources/coin.wav

0
resources/mecha.png → src/resources/mecha.png

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

2
src/screen_title.c

@ -64,7 +64,7 @@ void DrawTitleScreen(void)
// TODO: Draw TITLE screen here! // TODO: Draw TITLE screen here!
DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), GREEN); DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), GREEN);
Vector2 pos = { 20, 10 }; Vector2 pos = { 20, 10 };
DrawTextEx(font, "Lemonade Stand", pos, font.baseSize*3.0f, 4, DARKGREEN); DrawTextEx(font, "TITLE SCREEN", pos, font.baseSize*3.0f, 4, DARKGREEN);
DrawText("PRESS ENTER or TAP to JUMP to GAMEPLAY SCREEN", 120, 220, 20, DARKGREEN); DrawText("PRESS ENTER or TAP to JUMP to GAMEPLAY SCREEN", 120, 220, 20, DARKGREEN);
} }

Loading…
Cancel
Save