Add Missile Command game for T-Deck + desktop emulator
Game (examples/MissileCommand): - Classic Missile Command: 6 cities, 3 batteries x 10 missiles, escalating waves, smart bombs, score multiplier, session high score - Trackball aims, press/tap fires, keyboard A/S/D selects battery, screen tap aims+fires - Rendering: incremental TFT_eSPI drawing (persistent enemy trails that vanish on death, no AA-rocket trails, explosion circles that repair terrain, ghost-free crosshair) - Sound (sound_engine.cpp): non-blocking I2S task on core 0; wave-start alarm of four falling tones (like the original), sweeps/noise effects, U/V/M keyboard volume control with OSD, master volume scaling Emulator (emulator/): - SDL2 host that compiles the unmodified sketch against shim headers (Arduino, TFT_eSPI->framebuffer, GT911 touch, I2C keyboard, I2S->SDL audio); arrow keys emulate the trackball, --autoplay/--frames/--dump flags for headless smoke tests
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
# Local SDL2 emulator for MissileCommand (run the game on your PC)
|
||||
#
|
||||
# make build ./missilecommand-emu
|
||||
# make run build + launch the window
|
||||
# make smoke headless test: 240 frames, dump the last frame to a BMP
|
||||
#
|
||||
CXX ?= g++
|
||||
CXXFLAGS ?= -std=gnu++17 -O2 -Wall -Wextra
|
||||
SDLFLAGS := -I/usr/include/SDL2
|
||||
INC := -Isrc/shim -I../examples/MissileCommand
|
||||
LIBS := -lSDL2 -lSDL2_ttf
|
||||
|
||||
GAME_DIR := ../examples/MissileCommand
|
||||
SHIMS := $(wildcard src/shim/*.h) $(wildcard src/shim/driver/*.h)
|
||||
EMU := missilecommand-emu
|
||||
|
||||
.PHONY: all run smoke clean
|
||||
|
||||
all: $(EMU)
|
||||
|
||||
$(EMU): src/main.cpp $(GAME_DIR)/sound_engine.cpp $(GAME_DIR)/MissileCommand.ino $(SHIMS)
|
||||
$(CXX) $(CXXFLAGS) $(SDLFLAGS) $(INC) \
|
||||
src/main.cpp $(GAME_DIR)/sound_engine.cpp -o $@ $(LIBS)
|
||||
|
||||
run: $(EMU)
|
||||
./$(EMU)
|
||||
|
||||
# Headless smoke test: dummy video/audio, run N frames, save the last frame.
|
||||
# Feed some keys: 'a' starts the game, arrows steer, etc. via --script.
|
||||
smoke: $(EMU)
|
||||
./$(EMU) --frames 240 --dump smoke_frame.bmp
|
||||
|
||||
clean:
|
||||
rm -f $(EMU) smoke_frame.bmp
|
||||
Reference in New Issue
Block a user