olc::PixelGameEngine 2.0 is here!

After quite a few late nights, it’s finally here! PGE 2.0 is a significant upgrade on its predecessor, and is 100% backward compatible. This major revision brings in hardware accelerated sprites in the form of the olc::Decal, multiple rendering layers, and has been completely re-organised to make it easy to port to other platforms.

The features added were in response to the fantastic feedback from this community. You guys wanted to use it as a genuine game engine? Now you can.

Download from the Github Repo and try for yourself!

Casting Bit Magic

Pt. 1 Binary Representation and Endianness

Introduction

This article began as an explanation of the “fast inverse square root algorithm” found in the source code of Quake 3 by id Software. While working on the article and receiving feedback I realized that I would better split the article in a small series about binary representation and the floating point type. We will begin at the basics of bit representation and ending the series with some nice bit trickery with the floating point format. The goal of the article is that beginner level programmers can understand the lower level workings of their machine. I do sincerely hope I have included enough material that also the more experienced programmer will enjoy the content. So here is the first entry!

Continue reading “Casting Bit Magic”

New PixelGameEngine Extension for Animating 2D Sprites

One of the things I struggled with when using the PixelGameEngine was using animated sprites. It wasn’t immediately obvious how to get it to work, so over the Christmas break I decided to make a concerted effort to figure it all out.

The end result was a brand new extension for Javidx9’s PixelGameEngine. So, I would like to present the olcPGEX_AnimatedSprite with a small tutorial on how to use it.

Continue reading “New PixelGameEngine Extension for Animating 2D Sprites”

Drawing many large sprites with the pixel game engine (AKA achieving parallax with the pge)

please note this article refers to the pixel game engine version 1, version 2 will have support for far more optimal large sprite rendering out of the box, however some of the information here might be interesting to others that follow. especially if wanting to do own manipulation of sprites.

Continue reading “Drawing many large sprites with the pixel game engine (AKA achieving parallax with the pge)”

Enough! Why rand() cant compress!!!

Unless you are born an information theory genius, at some point during your programming learning you might have considered the following hypothesis:

A file is a sequence of bytes. If I could find the appropriate seed for srand(), surely I could generate the file, just by successively calling rand() % 256? Therefore I could represent the file with just the seed and the expected file length.

Continue reading “Enough! Why rand() cant compress!!!”

Small Project Planning

It’s codin’ time…

Planning well is the key to successfully finishing a project, and it does not solely apply to large projects. Even your small one file programs could really benefit from a plan before you start. If you’ve ever watched one of my videos, you’ll frequently see me drawing my intentions on screen – this is not just for a visual demonstration, more often than not, these drawings are inspired by squiggles I drew while I was planning the project. In this post I want to point out a few things that I do to ensure in the very least, I reach my project goals.

Continue reading “Small Project Planning”