Jump to content
  • entries
    13
  • comments
    31
  • views
    16098

Developing a small game with built-in level editor!

Sign in to follow this  
CoffeeCoder

1361 views

It has been a long time since I've posted anything in this journal, in fact I sort of forgot about its existence! Won't do that again. :)

I'm not sure how many people are familiar with it, but I'm using App Game Kit from The Game Creators, the same company behind DarkBASIC, to create the base engine for a really simplistic game. I won't get into too much detail about the game now, but suffice to say it should be a fun one to program!

One of the features of the game is going to be a built-in level editor which will allow the player to create their own unique levels. It will be fairly easy to implement, as the editor is basically going to be its own program in a separate included file, which will store map data in an array that the main engine will be able to use. I love building level editors, but there are a few things I realized player's would want in one.

  • A GUI System (while I'm comfortable using keys and text, players will want buttons)
  • Undo/Redo Funcionality

    Both of those things I plan to work on and get operational before I start work on anything else. I'm actually working on the Undo/Redo API first as I thought that would be the most difficult. Turns out it is actually really easy!

    First, I'm creating a custom type to store metadata in, then declaring two global arrays based on the type. Whenever an action is performed, I call a function which will record the action into the undo stack. Whenever someone undoes the last action, it will copy the information from the current element of the undo stack into a new element of the redo stack (say all of this ten times fast, I dare you! :P ).

    In order to keep memory usage down, there will be a limit of 50 undo/redoes available. But the really good thing about this system will be just how customizable it is, if the user wants to record other types of data, all they have to do is add the necessary information to the custom metadata type.

    I know there are much better ways to handle something of this nature, but this was the best solution I could come up with and I'm sticking to it! Anybody here use AGK that might be interested in it? :)
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!