r/onelonecoder

55 archived posts · Mar 2019 – Jul 2025

Random post

u/granitrocky•

So Last weekend I started porting over the OLC Pixel Game Engine 2.08 into Rust because

A) I wanted to learn and

B) I'm a masochist

I'm trying to keep the same spirit as the original (ie, One file, minimal dependencies, implement 3 functions and you have a running game)

So far it's only compiling for Windows, but I have the basics down. I can draw the Layers and Decals, and even set pixels.

I haven't started reading hardware inputs and I need to finish up all the drawing routines, but I think I'm past the hardest parts.

I was wondering if anyone has tried porting the engine to other languages than C++ and what their success level was?

One thing I should note, and I don't know if it's

111

u/Williamkwusik•

Just wanted to check if you would like to see my code of adding PGE 2.0 to a JUCE project. So I could use JUCE Audio and other things together. So far it seems to work. I could make a small project test if you want to share it. :-) Even include some easy to use audio MP3/WAV playback. JUCE already has a sampler but I think it's a bit hard to use for noobs. And I don't like the code. Anyway, I'm WilliamK from Wusik.com, a small dev for audio plugins. :-) Thank you so much for doing the PGE 2.0! Cheers!

73


[deleted]•

I made an adjustment to the Snake command console game by using the arrow keys to move in the pressed direction. This felt more intuitive to me, and as a beginner programmer it was pretty easy to implement. Let me know if it could be improved somehow.

First, I removed the bRightKeyOld and bLeftKeyOld variables and added two new booleans, bUpKey and bDownKey. Then I added their input references just like the left and right keys:

bUpkey = (0x8000 & GetAsyncKeyState((unsigned char)('\x26'))) != 0;

bDownKey = (0x8000 & GetAsyncKeyState((unsigned char)('\x28'))) != 0;

​

No longer needing the old input, I used the following if-branches to change direction and make sur

60

u/scorin•

Hi All,

I have spent the last week going through part 2 (CPU emulation) as a way to hopefully step up my C++ game. It has been an absolutely fantastic learning experience! My problem is that while I have a decent grasp on all the parts I do not understand the whole. What I am looking for is where the first instruction of the cpu is executed so I can make out how the emulation gets to the point of performing the next. If anyone has any guidance on how to that would be appreciated.

62

u/UberSeal•

Here's the code: https://github.com/SeanJxie/3d-engine-from-scratch

along with a demo to check things out.

I've implemented the use of mouse controls and used a slightly different file structure, alongside some implementations of triangle rasterization as SDL does not provide any "filled" drawing functions.

There are still quite a few features to implement as of now, such as the lighting system (which is built on top of an effective rasterization system), but I believe that progress is being made. Furthermore, this is (quite unexpectedly) my first C++ project, so any strange programming technique I use may be attributed to the fact.

I

60




u/MrMeticulousX•

Quick question — in the olcPixelGameEngine, I've already created custom thematic mouse cursors to use, but I can't seem to figure out how to hide the mouse cursor of the OS.

Is there a straightforward cross-platform method of hiding the mouse when the game is running in focus, within the engine's code? Would really help a lot.

Thanks!

50

u/khanoa•

Hi!

I recently saw that Javidx9 has created a github repo with what seems to be the skeleton of a VM for maybe a language interpreter (?). Well, I don't know much about this field of programming, so is my intuition right? Do we know something more about this?

Also it would be insanely cool to see a tutorial about creating a programming language by Javid.

Cheers!

56