At 11/13/06 03:16 PM, The-Super-Flash-Bros wrote:
But classes, I couldnt live without classes. Not really sure how I programmed before them
Suprisingly, I've yet to make a game in flash using mainly OOP (nightstrike 2 will be mainly OOP though)
Flash makes a lot of things easy. For blockslide 2, instead of creating a class for the blocks (as i started this before using classes in flash), i simply put function definitions in the onClipEvent(load) of the character and block clips.
It's a pretty bad habit to get into, but there's still only like 500 lines of code in that entire project (aside from the level code decomposition and composition algorithms... those are pretty heavy)
Dont get me wrong though, but those 500 lines of code are some of the most advanced stuff I've done. All the functions are being used multiple times each.
One of my nasty habits in flash is that i still duplicate my movie clips. Every time i mention that people go "What? Just use attaching lolsz". Does anyone else here still duplicate their movie clips?
On the other hand though, when I started learning c++ i realized how important classes actually are. I made a simple engine using no classes, then i realized that i would get nowhere that way, so I spent a little time learning. Now almost everything I do in c++ is in classes. I have a giant libary of classes I can reuse over and over again, for heightmaps, textures, MD2 file format loading and displaying and interpolated animation classes, 3D vector class, colors (RGB->Hex, visa versa), cubes, spheres, cones, cylinders, cameras, etc. I really dont know how I'd survive c++ without OOP.
But the truth is, flash is built upon OOP. They built in the most important classes, and therefore I just find it more difficult to code in OOP with flash. It just seems unnecessary when the same effects can be achieved with functions and such.
I'm probably just a creature of habit though.
I do however use a 2D Vector class and a Container (smart array) class in all my projects, and sometimes a camera class if necessary.