展示HN:我用自己的编程语言写了一个DOOM克隆版。
Show HN: I wrote a DOOM clone in my own programming language

原始链接: https://spectrelang.org/log/devlog#cubedoom

## Cubedoom:一款在Spectre中开发的复古FPS Cubedoom是一款快节奏的竞技场射击游戏,完全使用Spectre编程语言构建,并利用SDL2进行图形和输入处理。它受到《Wolfenstein 3D》和《DOOM》等经典游戏的影响,采用轻量级光线投射技术来创建其3D环境。 该项目最初是Spectre语言的一个实验,特别是利用其多维数组和C语言互操作性特性。游戏玩法经过有意简化:在迷宫中导航,与单一类型的敌人战斗,并生存下去。一个基本的HUD显示生命值和迷你地图,游戏还包含经典的视角晃动效果。 最近的更新(v0.0.5,2026年4月25日)为Spectre本身引入了令人兴奋的新功能,包括C到Spectre的翻译器、实验性的LLVM和C99后端,以及改进的编译速度。未来的开发计划包括添加声音、更多敌人类型和弹药系统。Cubedoom和Spectre语言都是开源的,欢迎贡献。

一位 Hacker News 用户(“pizza_man”)分享了一个使用他们自己编程语言 Spectrelang (spectrelang.org) 构建的《DOOM》克隆游戏。该游戏使用了类似于《Wolfenstein 3D》的光线投射技术,而不是原版《DOOM》更复杂的渲染方式。 评论者反应积极,赞扬了用自制语言创建游戏的成就,并承认了经典游戏的持久吸引力。最初的帖子引发了一段关于渲染方法的简短澄清,作者确认了《Wolfenstein 3D》风格的方法。该帖子还包含了一个关于他们 2026 年夏季 Y Combinator 申请的公告。
相关文章

原文

April 28, 2026

Cubedoom is an arena shooter implemented entirely in the Spectre Programming Language, it depends on the SDL2 and SDL2_Image dev libraries. It began as an experiment with the languages multi-dimensional array capabilities, on towards its C-interop (the extern-related "header" syntax was introduced in particular for compatibility with the alternate backend of the compiler). It uses raycasting rendering for its 3D world, similar in spirit to early first person shooters such as Wolfenstein 3D or the original DOOM.

At runtime each frame casts a set of rays from the player’s position, stepping through the map grid until a wall collision is detected. The distance to that collision determines the vertical slice height drawn to the screen, producing the illusion of depth, which keeps the engine lightweight. The game features a single enemy type and viewbob, as per classic DOOM, and a health/minimap HUD. The gameplay is intentionally minimal, in that the player navigates a maze-like arena, engages in combat with the enemies, and attempts to survive as long as possible.

The git repository for cubedoom itself can be found here.

Next on the roadmap is adding sound and more enemy types, along with an ammo-counting system. Spectre itself, and cubedoom both remain open to contributions.


April 25, 2026

New in v0.0.5:

  • --translate-c flag for translating from C code to Spectre code
  • New experimental LLVM backend
  • New experimental C99 backend
  • Improved type-level invariant syntax
  • Improved compile times due to optimizations in semantic analysis and module resolution
联系我们 contact @ memedata.com