This is a simple class that you can use to rapidly create a simple fps or old school role playing game. Games don’t necessarily have to be complex sometimes the beauty is in the simplicity. So let me give you a little history. Growing up I had a 486 and well I loved it spent more time on the 486 than I did speaking to class mates. Growing up I would spend countless hours in front of the computer. People would literally have to remind me to go outside and be active because I was always on the computer. I played many video games as a youngster. The 486 had 256 colors to me that was way cool. I can remember clearly thinking how high tech it was it had a digital output and boost button that made it speed up to a whole 33 mega hertz this made me immediately feel like I was going somewhere fast. We of course will all laugh about that now but that is how my intrest was sparked for computers. Video games Atari was cool but Nintendo and Sega were better and the 486 ran all the cool games. I can remember when I received my copy of Wolfenstien 3D. I immediately spent almost all of my time focused on beating this game. This game was a giant leap it validated shareware and the open source movement for me. I actually ordered this game as shareware though the snail mail system. In the eighties we had Gopher and BBS so we were really primitive and there was no internet as we know it today. So I would have to use my modem and call bbs often long distances and then download content which took forever and I would be scolded for the cost spent on the call. So that being said if I could snail mail something I would. #thankgodwedonthavetodothattoday!

So you liked to play video games? Yes of course I did. I copied them skipped school lunch to play on them. What games? I really like role playing games because they were complex long and had more goals to achieve. Wolfenstein was the first real fluid 3D video game. Role playing games though were usually 3D but turn based so not as fluid as Wolfenstein This genera was more or less owned by games like Might and Magic, Wizardry, and Bards Tale. Once Wolfenstein 3D was released Origin released a game called Ultima Underworld a 3D version of their long standing Ultima RPG(role playing game). This was the ground work for Elder Scrolls which they created and of course you have heard of Elder Scrolls everyone knows and respect it as the best RPG probably ever created. Games like this were usually based off of the dice and paper game Dungeons and Dragons that anyone can play providing they have an imagination, time, and a good Dungeon Master. As a kid of course I played Dungeons and Dragons. I even played it with my scout group in the middle of the Boundary Waters in Minnesota miles away from civilization as we know it.


#letspartylikeits1995
Might and Magic it was a big deal back in the day

So as you can see naturally I like old school video games! You can make something that is modern that borrows generously from the past. If you look at the Nintendo DS console you can see titles like Etrian Odyssey. Titles like these are absent from Android this really sucks and I would like to help change this. This is not the case for iOS you can get both Wizardry and Bards Tale through the apps store!


Download the Code for mobile app
Old School FPS!

That is the reason why I built this simple FPS to be used for old school rpgs or whatever. If you look at Deadly Dungeons on android it has 10 – 50 thousand installs and look at the interface it could use some improvement. I think at a minmum we can create something better with this. So please use this class as ground work for another project that is the reason I am placing it out please let me know if you make something cool with it. I am currently working on FPS in Unity for Android and iOS. I fully intend on improving this class and adding more classes to this API. So check back because this is only the first class of the api.

On a side note I would like to add that I have tried this ray cast method on the iOS with both Corona SDK and javascript canvas. I found both to these implementations in short to be too slow to be useful.

Why would you want to create a game this way? Well it is easy to generate a level all you have to do is manipulate the multi-dimensional array. That is way easier than it sound and the benefit of the array is it is visual. Look at it:

_map  = [ 
	[1, 1, 1, 1, 1, 1, 1, 1, 1, 1], // 0
	[1, 1, 0, 0, 0, 0, 0, 1, 1, 1], // 1
	[1, 1, 0, 0, 2, 0, 0, 0, 0, 1], // 2
	[1, 0, 0, 0, 0, 2, 0, 0, 0, 1], // 3
	[1, 0, 0, 2, 0, 0, 2, 0, 0, 1], // 4
	[1, 0, 0, 0, 2, 0, 0, 0, 1, 1], // 5
	[1, 1, 1, 0, 0, 0, 0, 1, 1, 1], // 6
	[1, 1, 1, 0, 0, 1, 0, 0, 1, 1], // 7
	[1, 1, 1, 1, 1, 1, 0, 0, 1, 1], // 8
	[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] // 9
	];

You know whats going on! The zeros represent space and the other areas have textures the textures are also create in an array so you can easily manipulate them. I will be adding a radar (where the user is) shortly. I will also be adding a random level creation method.

Disclaimer. If this code doesn’t work for you I don’t care. It is open source so if you can make something better do it. I am doing this for fun so it hasn’t been test on too many systems use it at your own risk. If something doesn’t work the way you want it change it:)

Owes Homage To these games:
Might and Magic
Ultima Underworld
Wizardry
Bard’s Tale
Wolfenstein 3D
Etrian Odyssey

Borrows Many if not all of the ideas found:
Nemesis built with threeJS
Corona SDK RayCaster
Canvas RayCaster in javaScript