Posts

Showing posts from 2014

How to use Blender as a Box2D Platformer Level Editor [Tutorial]

Image
Hey guys so you want a level editor but don't want to build one yourself right? Who does? You basically need to create a entire tangential project, with full GUI editor and undo tree etc. Unless that's a goal of yours (selling etc?) you probably want an easier solution. Well folks, look no further than your good friend Blender 3D. The same tool you use for modeling crazy cartoon knights swinging swords and whatnot, can be your level editor for your 2D game. A Plan So how do we do this? What do we need? We need a output format that's easy to parse. We need to decide on attributes that we can assign meaning to (for box2D and our game) The texturing and vertex placement etc, comes for free since we're using a 3D modeling format :) The OBJ file format. Why OBJ? This is super easy to parse. You could use another format, if you're already using a parser (I recommend ASSIMP :) ), but for this tutorial, I'm going to use OBJ so you ca...

How to render Parallax Background and Foreground Layers Completely in the Shader [Tutorial]

Image
EDIT Oct 16 2014 : Changed precision to lowp for fragment shader. Consider using this as a default for mobile, unless you really need something better.  I saw a 2x speed increase on Kindle by doing so. Hi all! Here's a quick little diddy for anyone curious on a quick way to get a layered effect in your 2D game (note: we are still using 3D vertices): I did a little more progress on Hoarder Monkey   and I am happy to have parallax backgrounds working all in the shader and in 1 draw call per object type (static VBO, dynamic sprites, Semi-transparent VBO, semi-transparent sprites).  :) The background scrolling is all handled in the shader, and works surprisingly well.  I also do some color tweaking to make things a little darker in the foreground and blue-ish in the background: Notice the closest graphics are darker Notice the background objects are a more blue/white hue. In case your curious the shader code is pretty simple (as it should b...

How To Set Up Your Game Event Queue (Threaded) [Tutorial]

Image
Hi all, Finally back with a simple, but hopefully helpful, tutorial for you all to get an working event queue in a threaded environment.  In this case I will be using Android C++ and JNI as my playground to demonstrate. What is an event queue An event queue is a list of events that has occurred since your last game loop iteration.  Possible Events are: Button presses on game controllers Screen touch events (press up/down, multi touch, etc). Keyboard events So what is the point of this anyhow?   Many times events will occur in the middle of your game loop, asynchronously.  In Android, they occur on a different thread by default, usually called the "UI thread". If you process them as they come in on your "UI Thread" you could end up with some nasty concurrency bugs and crashes due to processing the event (in your game etc) right while the game loop thread is updating the same data. This leads to some epic head scratching and lovely...

"Hoarder Monkey" Coming soon!

Image
You're a Monkey with a serious collecting problem!  Hoarder Monkey is a fresh take on action platformers that melds tilt action rolling movement, with Donkey Kong style action mechanics, with plenty of goofy humor and surprises. Can you collect all your  precious  missing junk before time runs out?  Beat your friends, impress the ladies... be *that guy*! Forget your 12 step programs, play Hoarder Monkey and indulge in all your OCD fantasies! Insane enemies, Rabid Squirrels and Monkey with a trash bag strapped to his back!  It has everything! This guys didn't satisfy his collecting urges by playing Hoarder Money! Don't be this GUY! I mean  common... Rabid squirrels and such! "It's a squireeel! It's dead!".  Well nearly.. anyhow.   So yeah, that's it for now, still working on levels features and all that Hoarder Monkey specific Blog on the way! Coming soon to:...