百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

space-shooter.c

> 数据库
开源

这是一款跨平台的、从上到下的 2D 空间射击游戏,使用仅包含平台库的 C 语言编写。

1.4K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

这是一款跨平台的、从上到下的 2D 空间射击游戏,使用仅包含平台库的 C 语言编写。

space-shooter.c

A cross-platform, top-down 2D space shooter written in C using only platform libraries.

Dependencies

  • Base: Win32 (Windows), Xlib (Linux), Emscripten (Web)
  • Rendering: OpenGL 3.3 (Windows/Linux), OpenGL ES 3.0 (Web)
  • Audio: XAudio2 (Windows), ALSA/pthread (Linux), OpenAL (Web)
  • Gamepad: XInput (Windows), evdev (Linux), Emscripten (Web)

Description

space-shooter.c is a cross-platform, top-down 2D space shooter written in standard C11 using only platform libraries (with platform libraries defined as anything included in the C standard library or supported platforms). space-shooter.c has been tested on Windows 10, Ubuntu Linux 16.04, Chrome 103 and Firefox 103. This project drew heavy inspiration from Handmade Hero and pacman.c.

The design and architecture of space-shooter.c is described here.

Caveat

I am not a professional game developer, nor a professional C programmer, so the design may be unconventional or sub-optimal in many ways. Happy to take feedback from any pros out there!

Building

Windows

  • In a shell with cl set up, run build.bat for a debug build or build.bat release for an optimized build.
  • Run space-shooter.exe from the build/ directory.

Linux

  • Make sure development headers for the Linux kernel, Xlib, glx and ALSA are installed.
    • E.g. on Ubuntu, run the following: sudo apt install linux-libc-dev libx11-dev mesa-common-dev libasound2-dev
  • Run make linux for a debug build or make linux-release for an optimized build.
  • Run ./space-shooter from the build/ directory.

Web

  • Make sure make and emscripten are installed.
  • Run make web for a debug build or make web-release for an optimized build.
  • Serve the build/ directory for debug builds or the site/ directory for release builds from a local web server (e.g. python -m SimpleHTTPServer), and open the page in Chrome or Firefox.

What About Mac?

I hope to work on a Mac platform layer as soon as I have a Mac machine to work on.

Contributing

Since this project is intended as a personal challenge, I am not accepting external contributions at this time. I am very open to feedback, however, so feel free to open an issue for anything that needs fixing.

Asset Credits

  • Sprites: https://ansimuz.itch.io/spaceship-shooter-environment
  • BG Music: https://chiphead64.itch.io/free-game-soundtrack-by-cactusdude-hurry-up
  • SFX: https://fallenblood.itch.io/50-sfx
  • Font: https://gpway.itch.io/white-pixel-sprite-font

GitHub Issues· 0 开放

在 GitHub 查看全部

暂无开放 Issues,或尚未同步最近议题。

核心特点

  • •Base: Win32 (Windows), Xlib (Linux), Emscripten (Web)
  • •Rendering: OpenGL 3.3 (Windows/Linux), OpenGL ES 3.0 (Web)
  • •Audio: XAudio2 (Windows), ALSA/pthread (Linux), OpenAL (Web)
  • •Gamepad: XInput (Windows), evdev (Linux), Emscripten (Web)
  • •In a shell with cl set up, run build.bat for a debug build or build.bat release for an optimized build.
  • •Run space-shooter.exe from the build/ directory.
  • •Make sure development headers for the Linux kernel, Xlib, glx and ALSA are installed.
  • •E.g. on Ubuntu, run the following: sudo apt install linux-libc-dev libx11-dev mesa-common-dev libasound2-dev
  • •Run make linux for a debug build or make linux-release for an optimized build.
  • •Run ./space-shooter from the build/ directory.

> 标签

Cccross-platformemscriptengame-development

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类数据库
定价开源

> 相关工具

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库