From d34ecf887fbe8f64436d4f28a8a3489ec728140e Mon Sep 17 00:00:00 2001 From: frank Date: Tue, 26 Jul 2022 17:41:46 -0400 Subject: [PATCH] use implicit variables for c/c++ compiler in Makefile; add README; enable screenshots and video --- Makefile | 20 +++++++------------ README.md | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++ config.json | 10 ++++++++++ lib/sb | 2 +- 4 files changed, 74 insertions(+), 14 deletions(-) create mode 100644 README.md diff --git a/Makefile b/Makefile index 4a8e1c3..6886a90 100644 --- a/Makefile +++ b/Makefile @@ -16,10 +16,6 @@ SB_LIB_DIR := $(SB_DIR)lib/ SDLGFX2_DIR := $(SB_LIB_DIR)sdl2-gfx/ GLEW_DIR := $(SB_LIB_DIR)glew/ -# C and C++ compiler commands -CC := clang -CPPC := clang++ - # Location of SDL config program SDLCONFIG := $(HOME)/local/sdl/bin/sdl2-config @@ -43,7 +39,7 @@ SRC_O_FILES := $(SRC_H_FILES:.hpp=.o) $(SDLGFX2_DIR)%.o: $(SDLGFX2_DIR)%.c $(SDLGFX2_DIR)%.h $(GLEW_DIR)%.o: $(GLEW_DIR)%.c $(GLEW_DIR)%.h - $(CC) $(CFLAGS) $< -c -o $@ + $(CC) $< $(CFLAGS) -c -o $@ $(SB_SRC_DIR)extension.o : $(addprefix $(SB_SRC_DIR),Box.hpp Segment.hpp Color.hpp filesystem.hpp Pixels.hpp Log.hpp) $(SB_SRC_DIR)Node.o : $(addprefix $(SB_SRC_DIR),Game.hpp Configuration.hpp Delegate.hpp Display.hpp Input.hpp Box.hpp Audio.hpp Log.hpp) @@ -66,21 +62,19 @@ $(SB_SRC_DIR)VBO.o : $(addprefix $(SB_SRC_DIR),Log.hpp GLObject.hpp Attributes.h $(SB_SRC_DIR)Attributes.o : $(addprefix $(SB_SRC_DIR),Log.hpp extension.hpp) $(SRC_DIR)Pepy.o : $(SRC_H_FILES) $(SB_H_FILES) %.o : %.cpp %.hpp - $(CPPC) $(CPP_FLAGS) $< -c -o $@ + $(CXX) $< $(CPP_FLAGS) -c -o $@ ############### # Linux build # ############### -linux : CC = clang -linux : CPPC = clang++ -linux : CFLAGS = -g -Wall -Wextra -O0 -c -I$(SB_LIB_DIR) -I$(SB_SRC_DIR) $(SDL_CFLAGS) +linux : CFLAGS = -g -Wall -Wextra -O0 -fPIE -c -I$(SB_LIB_DIR) -I$(SB_SRC_DIR) $(SDL_CFLAGS) linux : CPP_FLAGS = $(CFLAGS) --std=c++17 -linux : LFLAGS = $(SDL_LFLAGS) -lpthread -lGL -lGLESv2 -lSDL2_image -lSDL2_ttf -lSDL2_mixer -lstdc++fs +linux : LFLAGS = $(SDL_LFLAGS) -fPIE -lpthread -lGL -lGLESv2 -lSDL2_image -lSDL2_ttf -lSDL2_mixer -lstdc++fs linux : $(GLEW_DIR)glew.o $(addprefix $(SDLGFX2_DIR),SDL2_rotozoom.o SDL2_gfxPrimitives.o) \ $(SB_O_FILES) $(SRC_O_FILES) $(CREATE_FONT_SYMLINK) - $(CPPC) $(LFLAGS) -D__LINUX__ $^ -o pepy + $(CXX) $^ $(LFLAGS) -D__LINUX__ -o pepy ############# # Web build # @@ -97,12 +91,12 @@ EMSCRIPTEN_PRELOADS = --preload-file "BPmono.ttf"@/ --preload-file "config.json" --preload-file "src/shader.vert"@/"src/" --preload-file "src/shader.frag"@/"src/" emscripten : CC = $(EMSCRIPTENHOME)/emcc -emscripten : CPPC = $(EMSCRIPTENHOME)/em++ +emscripten : CXX = $(EMSCRIPTENHOME)/em++ emscripten : CFLAGS = $(EMSCRIPTEN_CFLAGS) emscripten : CPP_FLAGS = $(CFLAGS) --std=c++17 emscripten : $(addprefix $(SDLGFX2_DIR),SDL2_rotozoom.o SDL2_gfxPrimitives.o) $(SB_O_FILES) $(SRC_O_FILES) $(CREATE_FONT_SYMLINK) - $(CPPC) $(CPP_FLAGS) $(EMSCRIPTEN_LFLAGS) $(EMSCRIPTEN_PRELOADS) $^ -o "index.html" + $(CXX) $^ $(CPP_FLAGS) $(EMSCRIPTEN_LFLAGS) $(EMSCRIPTEN_PRELOADS) -o "index.html" ######################### # Clean up object files # diff --git a/README.md b/README.md new file mode 100644 index 0000000..d0580dc --- /dev/null +++ b/README.md @@ -0,0 +1,56 @@ +Pepy: Make it Big +================= + +It's Pepy's first game, and you're in control of how big. Shake as much as you can in 10 seconds to see how far you can fling Pepy across the galaxy. + +![Pepy](https://5.nugget.fun/img/pepy.png) + +Where to play +------------- + +Pepy is currently in-development. Public builds for the web and Android are expected to be released soon. For now, you can follow the instructions below to build from source on Linux. + +Building from source on Linux +----------------------------- + +This game currently requires Linux to build from source. To build on Linux, clone this repository, using the `--recursive` flag to also get the [SPACEBOX][] framework as a submodule: + + git clone --recursive https://git.nugget.fun/nugget/pepy.git + +Follow the instructions for running SPACEBOX, particularly the [Installing Requirements][] section. Once you've installed all the requirements of SPACEBOX, make sure the paths in [Makefile][] match the ones on your system. For example, the path to `SDLCONFIG` may have to be updated to match the location where you installed SDL. Afterward, you should be able to run `make`: + + make linux + +If you would like to make a web build, first install [Emscripten][], and then make sure `EMSCRIPTENHOME` in the [Makefile][] is set to your Emscripten directory before running `make`: + + make emscripten + +Manual +------ + +The goal is to fling the balls as far apart from each other as possible. The size of the area covered by the balls is the player's score. The player builds up energy by shaking the balls for 10 seconds, then they are automatically flung into space. + +### Mouse + +Click and hold the mouse button to grab. Drag the mouse while grabbing to shake. + +### Keys + +Use the arrow keys to shake. + +About +----- + +This is the first game planned for an online arcade at . It is also one of the first games made with the [SPACEBOX][] game framework. The initial prototype was made for [UWILLNOTLAST10SECONDS][]. + +Contact +------- + +* email: bam (at) nugget.fun +* twitter: + +[SPACEBOX]: https://git.nugget.fun/nugget/sb/src/branch/cuckoo +[Installing Requirements]: https://git.nugget.fun/nugget/sb/src/branch/cuckoo#installing-requirements +[Emscripten]: https://emscripten.org +[Makefile]: Makefile +[UWILLNOTLAST10SECONDS]: https://itch.io/jam/uw1llnotl4st10s3conds diff --git a/config.json b/config.json index 13ffc66..c042a6d 100644 --- a/config.json +++ b/config.json @@ -8,6 +8,16 @@ "render driver": "opengles3", "show-cursor": true }, + "recording": + { + "screenshot-directory": "local/screenshots", + "video-directory": "local/video", + "enabled": true, + "write-mp4": true, + "video-frame-length": 33.333, + "max-video-memory": 2000, + "mp4-pixel-format": "yuv420p" + }, "configuration": { "auto-refresh": true diff --git a/lib/sb b/lib/sb index a3fba9c..9fd3ee2 160000 --- a/lib/sb +++ b/lib/sb @@ -1 +1 @@ -Subproject commit a3fba9c38aa344e8352abc101a4410bc544afcdf +Subproject commit 9fd3ee282e535e8247a8c0a39827f049400243ea