Sunday, April 6, 2008

Singleton Blocks

It seems kind of extreme to have the blocks themselves be singletons. I could just have shared resources, image, etc. The thing is, I really don't see why they can't be shared.

If we use a 3D graphics mesh as an example, the grid can be likened to triangles and these blocks are the textures. I'm just going to roll with it until something really ugly pops up.

A Humourous Note

When I reimplemented the Stone Blocks as singletons the AI became confused. That was because I let the singleton approach lapse and started doing things I shouldn't like comparing blocks!

The correct approach is to compare Block Coordinates. I may want to create some kind of handle class that contains coords etc. Hmmm...

Lesson is: Don't Let It Lapse!

No comments: