Tuesday, July 27, 2010

Dynamic control forms/objects and more abstract classes

The difference between normal inheritance and abstract inheritance is that an abstract class must be inherited or it could cause compile issues (C++ would have run-time issues) in the program or not function properly as they are built to allow "children" classes to specialize in certain functions.

For example, in a popular game such as Team Fortress, all the player classes have similar traits but some classes can vary such as in Team Fortress 2, a Spy can use a cloak and become invisible or the Scout can double jump. Those traits are specific to that class and cannot be done by any other class. They all have traits in-common though, such as using Health, Weapons, Movement Speed, etc.

Now that I've explained this, time to move onto the difference between Design-Time and Run-Time. I'd prefer to explain this phenomenon as Static Controls/Classes and Dynamic Controls/Classes as Design-Time doesn't technically apply to all languages but only languages that have a Form Designer such as VB.NET.

In any case, the difference between the two is that there are static objects which will always be in the program and there are objects that may or may not be created and deleted "on-the-fly" such as extra form controls (Text Box, Labels, Buttons) and instances of classes. These things can't always be accounted for which is why it is preferred to use Static Classes as much as possible as to not accidentally exceed the RAM limit at Run-Time or cause Memory leaks (which I think VB.NET handles by itself anyway)

In any case, that's all I have to say for now, till next time :D

Friday, July 23, 2010

The Console Program



If you don't know me at all in the "real world" then you probably don't know that I built a PC for the sole purpose of running emulated roms played via Xbox 360 wireless controls. For this to not require a mouse/keyboard, I decided to code my own application to launch the emulators/roms via the Xbox 360 controller.

Originally the application was written in Game Maker 6.1 but unfortunately it caused the N64 emulator to lag and not get enough CPU, so I rewrote it (very quickly) in C++. Fast forward a year, to now and I'm recoding it from scratch as the old version was written with my OLD game engine, both of which were horribly annotated and hard to read.

Whilst there is no aesthetic changes, the performance should be better, and dynamic array crashes shouldn't occur anymore. I also know how to work with the WinAPI much better so a lot of redundant code was removed :)

Monday, July 19, 2010

Abstract Classes

Abstract classes are created when two or more classes share the same states and behaviors. By creating a parent class once with all the necessary states and functions it saves having to double up code which saves time and RAM usage.

Abstract classes are also never instantiated on their own and are only used to help the child/specialized classes.

An example of an abstract class is a group of students at a school. They all have names, a student ID, a house group and a list of classes but some students have a few other qualities such as skills in sports, IT or be part of a school club, these are some things the other students may not have so its specific to a selected few.

Saturday, July 3, 2010

Map Editor, Rectangle Tool Implemented



The latest edition to my Map Editor has been created, the Rectangle tool. Now I can easily create rows, columns of tiles to help fill up those empty spaces with simple things such as grass.

I also recoded how tile-sets are handled, so now they can only have a max height of 256, but 'technically' infinite width (4 billion pixels wide)

Currently making the saving system :D