BMax OOP rocks!

Miscellaneous Forums/General Discussion/BMax OOP rocks!

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

yeah I like sprite.Draw() and sprite.Manage() etc Also sprite.Init(). Sometimes I'll extend sprite to do player.draw() and override draw() but other times I won't need to, e.g. Bullet.Draw() as the sprite one is good enough.

The other cool thing is changing how a method works, yet to everything external, nothing is different. So you can upgrade stuff easily without breakikng things.

Also making stuff like TLoadingScreen which has other types as part of it such as TLoadingBar and TClickHereButton etc. Encapsulation is cool as is inheritance and polymorphism, oh and wrapping just when you feel lazy.

I'm also into using lists to store game graphics and sounds instead of arrays so that when I want to assign a graphic or sound to a sprite I can refer to it by name instead of an integer value or constant which may have to change as you grow the game (which is a pain).

However, I wouldn't say any of this is unique to BMax it's all standard OOP stuff it's just nice and easy in Max. At first I was dubious of having the methods and functions inside of the Type instead of just declaring them in the type and implementing them fully further down (to keep big types concise) but I don't mind it now, it's better for small types though.