Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
B

BananaBread

> 编程语言
Open source

BananaBread is a C++ 3D game engine that runs on the web using JavaScript+WebGL+HTML

1.4K stars0 likes0 views
WebsiteGitHub

About

BananaBread is a C++ 3D game engine that runs on the web using JavaScript+WebGL+HTML

The BananaBread Engine


Notice

BananaBread is no longer under active development. A fork of this project, cfoust/sour, has continued the effort. Among other things, it adds support for multiplayer servers, upgrades the engine to the latest version of Sauerbraten, and supports all of the game's maps.


A port of the Cube 2/Sauerbraten 3D game engine/first person shooter to the web, compiling C++ and OpenGL to JavaScript and WebGL using Emscripten.

See the FAQ.

Demos

A live demo is available. Note that it requires WebAssembly.

Overview

Cube 2 is a compact and efficient 3D game engine. By compiling it to JavaScript and WebGL you can run a complete first person shooter in your web browser, using only standard web APIs and without any plugins.

Features:

  • A multitude of visual effects including water reflection/refraction, parallax mapping, glare, particle effects, lightmaps, skeletal animation (on gpu), etc. etc.
  • Streamlined and quick physics system
  • Ragdoll physics
  • Bot AI with adjustable skill level
  • Integrated in-game editor
  • Fast performance both running on the web or natively
  • zlib license

The original engine also has a lot of other features not yet enabled (but will be):

  • Multiplayer
  • Multiplayer editing
  • Shadowmapping

Building

Get emscripten and its dependencies,

http://emscripten.org

It's recommended to go through the emscripten tutorial to see that it is set up properly.

Then do emmake make client -j8 in cube2/src/web for a web build. (You can also do make in cube2/src/native for a native linux build.)

You can then run bb.html (in cube2/) to see the output.

If you have any problems building, feel free to file an issue here or to find us on emscripten IRC (see emscripten site).

  • See needed.txt for some possibly useful scripts to package the output.

Running

  1. Run python -m SimpleHTTPServer 8888 in cube2/

  2. Load localhost:8888 in your browser

Modding

To use maps of your own or make other kinds of changes or additions to the artwork, see the Modding page.

Debugging

If you append ,debug to the URL of one of the levels, it will use bb.debug.js instead of bb.js. The debug build has not been run through closure compiler and is much more readable for stack traces and profiling and so forth.

License

Code

Code is zlib licensed (just like Sauerbraten):

Copyright (C) 2001-2012 Sauerbraten authors (see cube2/src/readme_source.txt) and BananaBread authors (see below)

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.

BananaBread authors:

  • Alon Zakai
  • Gregor Koch
  • Bobby Richter

Art

All art content in this project (levels/maps, character model, etc. etc.) is either CC-BY or CC-BY-SA, which means you can use it in your projects, including commercial ones. If a directory does not contain a specific license file, then it is new artwork created for this project, which has the CC-BY license,

https://creativecommons.org/licenses/by/3.0/

and copyright is held by the Mozilla Foundation.

Previously-existing content can also be CC-BY-SA, see license files in specific directories.

GitHub Issues· 44 open

View all on GitHub
  • #96

    Compiling error while building the web build.

    Updated Sep 3, 2025
  • #93

    I followed the instructions to install Emscripten but ...

    Updated Sep 3, 2025
  • #94

    Deploying on GitHub pages.

    Updated Aug 30, 2023
  • #86

    How do you change your name?

    Updated Nov 11, 2021
  • #84

    level loading issue

    Updated Feb 9, 2021
  • #12

    Make it easy to use new maps

    Updated Dec 17, 2020
  • #83

    shared/cube.h:54:10: fatal error: 'enet/enet.h' file not found

    Updated Aug 25, 2020
  • #57

    Get some gaming happening!

    Updated May 27, 2019
  • #81

    Uncaught RangeError: Source is too large

    Updated May 12, 2019
  • #65

    Change the name?

    Updated Mar 28, 2019

Highlights

  • •A multitude of visual effects including water reflection/refraction,
  • •Streamlined and quick physics system
  • •Ragdoll physics
  • •Bot AI with adjustable skill level
  • •Integrated in-game editor
  • •Fast performance both running on the web or natively
  • •zlib license
  • •Multiplayer
  • •Multiplayer editing
  • •Shadowmapping

> Tags

C++

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言