• interested in more? sign up to the newsletter

     

Continuing on old code

Tweet about this on TwitterShare on RedditShare on Facebook

Meganoid3_week1ish2

This week I did a little interview about Space Grunts, random levels, Ouya and PC vs Mobile game development, so check it out over here.

I also finally got Heroes of Loot finished and ready for a May 26th Steam release! The new mouse-aim controls are so sweet, you can still play without just a keyboard and auto-aiming, but if you start using that mouse to target your enemies you’ll have a much better control obviously. It’s really worth checking out ;)

So how about some game development talk? Well, I took a small break from Space Grunts this week to continue work on some slightly older code. You might remember I was working on a level generator back in December (before starting on Space Grunts). It turned from a jetpack-flying game to a platform run and jump game.

This week I went back to that code, dove into the level generator and improved it some more. Turning the closed-cave levels into more open-world platform levels. The bit I added was actually very little code: once the cave generation is done, I go through every horizontal line in the tilemap, and I find the most top empty spot, and remove all the solid stuff above it. This basically removes the “roof” of the map, and turns all the top-cave rooms into “above ground” area’s with a big sky above it.

The result is pretty cool:

It’s also possible to change the variables a bit for each level or world, so that you can have levels that are more focussed on vertical climbing or levels that are mostly horizontal based affairs. You can further more go for smaller-open rooms in a level, or big screen-size rooms. This makes it possible to have a variation in gameplay depending on the levels/world you are in.

The next improvement I did was turn most of the monster placements into “tiles” so that the level generator places tiles in the map where monsters should appear, and these tiles are then processed at run-time to turn the tile into a monster.  Saving a lot of monster-objects in memory and in the update cycle.

Bookmark the permalink.
  • Evelyn

    looking nice so far better at pixel art than me :P. I have a quick question for you, do you use the box2d library alongside libgdx and/or do you have your own library that you have built over the years? I’m asking because I’m diving into libgdx myself (after having some “fun” with java2d) and i wanted to ask someone who has had lots of experience with libgdx. I apologize for the placement of this question i wasn’t sure where to ask. Thanks :)

    • I don’t use box2d. The “physics” I use are extremely basic math falling under the “As long as it works” method ;) Gravity in my games is usually something like:

      Y+=ySpeed;

      if ySpeed<128 ySpeed+=..

      when hitground, yspeed=0

      simple, but effective! :p

      If you got more questions don't be afraid to just hop on the forums, it's still a bit empty, but somebody has to fill it! – http://www.orangepixel.net/forum/