All Projects → MatheusAvellar → brainfuck-game-engine

MatheusAvellar / brainfuck-game-engine

Licence: other
A brainfuck game engine -- because life wasn't hard enough before

Programming Languages

HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to brainfuck-game-engine

vbf
A brainfuck interpreter/compiler written in V.
Stars: ✭ 17 (-22.73%)
Mutual labels:  brainfuck
harbor
A language that ports⚓: examining the limits of compilation⚙️.
Stars: ✭ 81 (+268.18%)
Mutual labels:  brainfuck
uwuscript
World's first uwu-oriented language.
Stars: ✭ 75 (+240.91%)
Mutual labels:  brainfuck
Klipse
Klipse is a JavaScript plugin for embedding interactive code snippets in tech blogs.
Stars: ✭ 2,841 (+12813.64%)
Mutual labels:  brainfuck
FasterBrainfuckProgramming
This project is to make brainfuck language programming easier, faster and more powerful .. everything is made out of functions making it very easy to port to other languages
Stars: ✭ 19 (-13.64%)
Mutual labels:  brainfuck
bfpile
Optimizing Brainfuck compiler, transpiler and interpreter
Stars: ✭ 19 (-13.64%)
Mutual labels:  brainfuck
llvm-brainfuck
Brainfuck compiler based on LLVM API
Stars: ✭ 27 (+22.73%)
Mutual labels:  brainfuck
clickbaiter
Generates clickbait tech headlines. Don't ask why.
Stars: ✭ 40 (+81.82%)
Mutual labels:  useless
bfboot
A full brainfuck to bootable OS image compiler.
Stars: ✭ 35 (+59.09%)
Mutual labels:  brainfuck
asmbf
The only true brainfuck-targetting assembler.
Stars: ✭ 81 (+268.18%)
Mutual labels:  brainfuck
BrainF.Net
A .NET brainfuck code parsing and execution library
Stars: ✭ 23 (+4.55%)
Mutual labels:  brainfuck
AshBF
Over-engineered Brainfuck optimizing compiler and interpreter
Stars: ✭ 14 (-36.36%)
Mutual labels:  brainfuck
smpl
A superset of brainfuck with dynamic memory management.
Stars: ✭ 22 (+0%)
Mutual labels:  brainfuck
ojisan f-ck
おじさん風文章を解釈して動く Brainfuck interpreter
Stars: ✭ 20 (-9.09%)
Mutual labels:  brainfuck
flufflepuff
Fluffle Puff Programming Language
Stars: ✭ 23 (+4.55%)
Mutual labels:  brainfuck
BfBf
A Brainfuck interpreter written by Brainfuck.
Stars: ✭ 37 (+68.18%)
Mutual labels:  brainfuck
brainsuck
A simple optimizing Brainfuck compiler (used as the demo for my QCon Beijing 2015 talk)
Stars: ✭ 55 (+150%)
Mutual labels:  brainfuck
ooop
OOP has never been sooo professionally over engineered before.
Stars: ✭ 20 (-9.09%)
Mutual labels:  useless
yams
YAMS: Awesome MIPS Server
Stars: ✭ 17 (-22.73%)
Mutual labels:  brainfuck
BF-it
A C-like language to Brainfuck compiler, written in Python
Stars: ✭ 101 (+359.09%)
Mutual labels:  brainfuck

Brainfuck Game Engine

A work in progress game engine built to make use solely of the brainfuck language.

Screenshots

Insert funny 'an image is worth a thousand words' joke here, or something.

Development

The game code is separated in two files: load.bf and update.bf. The first is run only once, as to load a state to the tape, while the latter runs on every frame.

User input

Whenever the interpreter finds a , (comma) in the code, it reads whatever value is on the current cell and replaces it with the state of the corresponding input.

Valid values are listed below:

0 = Left arrow             => (0 = unpressed, 1 = pressed)
1 = Up arrow               => (0 = unpressed, 1 = pressed)
2 = Right arrow            => (0 = unpressed, 1 = pressed)
3 = Down arrow             => (0 = unpressed, 1 = pressed)
4 = 'A' key                => (0 = unpressed, 1 = pressed)
5 = 'S' key                => (0 = unpressed, 1 = pressed)
6 = X coordinate of mouse  => (0 to 24)
7 = Y coordinate of mouse  => (0 to 18)
8 = Mouse click            => (0 = unpressed, 1 = pressed)

Output

The game screen is drawn according to the first 25 × 19 = 475 cells in the program tape after the first cell. They are equivalent to a grid on the canvas, where each value corresponds to a color:

0 = No change (shows the background color)
1 = Black (#333)
2 = Gray  (#ccc)
3 = White (#fff)
4 = Red   (#c33)
5 = Green (#3c3)
6 = Blue  (#33c)

Values wrap around, so a value of 7 would be equivalent to a 0 (background color), a value of 8 would be equivalent to a 1 (black), and so on.

Eventually, I'll figure out a way to allow people to change the default background color.

Why

To quote intergalactically famous fictional scientist and inventor Rick Sanchez,

The reason anyone would do this, if they could (which they can't), would be because they could (which they can't)

Credits

As mentioned on the source code, full credits to copy for the initial code for the compiler, available online at https://copy.sh/brainfuck/. I highly recommend a visit to copy's GitHub, everything is awesome in there.

I will most likely finish replacing the compiler in the future with one fully built by myself. However, for the moment, this should do nicely.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].