Tag Archives: Code-It-Yourself

First Person Shooter at the Command Prompt – Update

-

One of my earliest videos was a simple raytracing engine that ran in the command prompt. In fact, here it is:

I felt it was time to give this project a bit more attention, and introduced textures and sprites into the engine. The end result has transformed the look of the engine, and you would be hard pressed to realise this was still done in a regular windows command prompt.

Jx9

Recording the good times

Hello!

Thought I’d have a little post just to record some of the cool stuff that’s been happening with the YouTube Channel!

  • You can now access the channel with a friendly link http://www.youtube.com/javidx9
  • Thanks to Yehoshua D. Stone (YouTube) who has had a go at porting the olcConsoleGameEngine to Linux (GitHub)
  • Thanks to Rene Kjellerup (GitHub) for converting the olcConsoleGameEngine to use SDL
  • Thanks to Brek Martin (YouTube) for porting over the Retro Racing Arcade Game to the PlayStation Portable (!)
  • Thanks to @Rraccd for a very flattering blog post regarding the Code-It-Yourself Tetris video. That project looks cool and I wish you the best of luck!

And of course thanks to the many viewers and subscribers for your really kind words in the comments. I set out to make some videos about code, and if people found them useful it was a bonus. Guess what? Some of them have!

Jx9

Wow…150 Subscribers

-

Hello!

When I started this blog six months ago, I didn’t really intend it to be a useful or entertaining resource, it was really just for me to record some programming ideas. Some of you may know why I started. During my academic and professional career I’ve mentored many young people, and frankly their coding skills suck. There are lots of reasons for this, but I believe the most important one is the quality of the programming resources available. Programming resources targeted at the aspiring programmer are mostly terrible. Books are boring, tutorials are baffling, videos are patronising and everyone who thinks they can code puts you down at every opportunity. The growing “maker” programming community believes you can get by with drag and drop coding, and cut & paste scripts – these offer a solution, but don’t teach anything.

My videos try to be a bit different, and I try to take the time to explain the algorithms and why they work. I don’t need to present the topics that are not important to this – GUIs, graphics libraries, off-the-shelf game engines. But you still need methods to display and accept input. So it appears I’ve carved a little niche with my “command line” approach. It also happens that this is a really low barrier to entry. I try to keep my programs to <300 lines. This is not some arrogant “look how great I am” thing, rather, it focuses me to produce only relevant, functional and clear code. Also humans can cope with about 300 lines, it’s easy to navigate and remember.

So I’ve been a little overwhelmed recently by the fact the YouTube Channel has just hit 150 subscribers, and I’d like to thank them all for taking an interest. It really does make it all worth while and I hope people are learning from the videos. I know they can be a bit geeky, a little dull, look a bit rough, but I’m made up with it. I’ve been surprised by just how much effort is required to make a good video and I know there are many video creators that can put me to shame, but the late nights, rows, frustration and coders-block have all been worth it, and I’m proud of the results so far.

Jx9

Information Is Beautiful

Hello!

Take a look at this. You don’t need to understand it, for my point to come across, but for now, please just look at it.

In preparation for an upcoming video I’m putting together, the code you see above is all that is required for a fully functional game of Tetris. I wrote it in a way that was readable by an average human (the intention of the video is to introduce some fundamentals), then reduced it until I had to go to bed. There is still scope to reduce it further, but something about it struck me. This handful of characters and digits contains enough information to play a fully functioning game of Tetris. This to me is no different from looking at a strand of DNA knowing that within is encoded all the necessary information to construct people. The characters above contain the definitions for the pieces (Tetronimos), the layout of the board, the rules of the game, animations for lines that disappear, rules for detecting collisions, increasing levels of difficulty, score keeping, user input and control and ultimately displaying it on a computer screen.

Some may argue “Sure, but it needs all the libraries and stuff and an OS to work, which means there’s millions more characters”. I can’t refute this but I propose it does not matter. This humble block of bytes above, is all the information needed within an existing ecosystem to present a fully functioning game of Tetris. DNA on its own doesn’t form life, it still needs an ecosystem to operate within. Likewise, that existing programming ecosystem will not on its own present a game of Tetris, it needs just this extra “blip” of information to make that happen.

At the risk of sounding like a pretentious git, there is a beauty to this. It’s not often that your eyes can perceive the whole of something in programming, but here we are, staring at an imposing rectangle of just about readable C++ code. There is nothing more, nothing hidden; and a programmer can see it is legitimate code, but this arrangement of symbols and characters is all that is required to form a complex, fun and interactive puzzle game, known to quite literally billions of people around the world.

I’ll be uploading the source soon enough, when the video gets finished, but for now, just staring at the image makes me really appreciate information in a new way.

Jx9