Browse Source

use implicit variables for c/c++ compiler in Makefile; add README; enable screenshots and video

main
frank 4 months ago
parent
commit
d34ecf887f
  1. 20
      Makefile
  2. 56
      README.md
  3. 10
      config.json
  4. 2
      lib/sb

20
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 #

56
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 <https://shampoo.ooo>. 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: <https://twitter.com/diskmem>
[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

10
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

2
lib/sb

@ -1 +1 @@
Subproject commit a3fba9c38aa344e8352abc101a4410bc544afcdf
Subproject commit 9fd3ee282e535e8247a8c0a39827f049400243ea
Loading…
Cancel
Save