Casting objects - Polymorphism

BlitzMax Forums/BlitzMax Beginners Area/Casting objects - Polymorphism

Here is something interesting you could do, have whole bunch of seperate movement types containing the methods for that type of movement, all extended from a base movement type.

Then each game item has a field that momvent type. Then you just do alien.movement.update()

It sounds complicated but might simplify things. You can just use one alien type but, esentially, plug-n-play with completely different movement and even extend this to attack methods as well.