- Great idea!
- Some sort of very rough mental planning
- Sit down to code
- Realise you need something to make the levels with because your levels are going cool storing them in a text file just wont cut it
- Now you realise you need to program some sort of GUI interface because hard coding everything is ugly and a pain in the arse to edit
- Get bored and realise your game wasn't so great after all
The video above shows some of the progress I've made, but doesn't really do it justice. Most of the important things are in the code. As you can see things are very far from being finished let alone polished so forgive the rubbish graphics and let me explain a little bit about how the GUI works, I'll use the moveable GUI Window in the video as an example.
The GUI Window is derived from a GUI Object. The only addition the Window has (you might have guessed), is that it's drawn with a background and title bar and can be moved around. The GUI Object itself has a vector of GUI Elements which it looks after by calling their respective input, logic and drawing routines. When each GUI Element is added to the GUI Object it's given a callback function which is triggered (depending on its own conditions, for example the "Buttons" you see in the video is a mouse click) within either the elements logic or input functions. This keeps everything nice and encapsualted so all the engine has to worry about is calling the GUI Objects input,logic,draw functions. I hope at least some of that made sense, it felt like a right mouthful.
The main aim of the GUI system is so that elements add specialised functionality through the way their callback functions are triggered, and the objects themselves (which handle the elements) can use these to create more complicated GUI Objects. I will have some examples of these in my next update, most likely the scrollbar, which will be made up of 2 GUI Elements, the 2 buttons at either end. I will add functionality for the drawing of the bar and position within the object itself (or atleast that's what I think in my head anyway).
I won't go on about the map just yet, because that's still way to incomplete, but you might have noticed I have the save and load functions working correctly (even if it is only the map name you see changing).
So until the next time, if you can't be good, be careful!
No comments:
Post a Comment