Game Development Community

dev|Pro Game Development Curriculum

Conway Life fun milestone

by Demolishun · 01/28/2007 (4:27 pm) · 3 comments

Here is a simple milestone image for my Conway Life playing, but there is a lot of code in here for just this simple widget:
demolishun.net/images/GuiGridCtrl_mile1.png
I created my GuiGridCtrl widget and it needed better support for line and texture drawing. Namely I modified a few dgl routines to allow for mid pixel rendering using antialiasing. You can view these changes here if you own TGE:
tdn.garagegames.com/wiki/Torque_Game_Engine/code/dglExt

I created a new class called CLifeCell which creates an object that has a bunch of data for each Life cell. I wanted code support so I could access the widgets directly (through C) using the GuiGridCtrl. I can access these CLifeCells when I add them to a list I have attached to my GuiGridCtrl.

Some cool features is that the object will only draw objects of type CLifeCells even if other objects are in the list. The list is exposed to the console so you can use normal console commands to check the contents of the list. In fact the list can be deleted and new one set for the GuiGridCtrl. This allows the list to be gui independent. I can also edit by clicking on the gui to add the cells. If the cell exists it will delete it. The grid can be an arbitrary number of X and Y positions as well.

My next step is to create another class that runs the life algorithm that accesses the list and can be linked to the GUI control. The trick is to somehow keep the class knowledgeable of the list and the gui. I may have to redesign how the GUI gets the cell list information.

Anyway, this has been really fun. I hope to get my life game up and running soon.

About the author

I love programming, I love programming things that go click, whirr, boom. For organized T3D Links visit: http://demolishun.com/?page_id=67


#1
01/28/2007 (10:06 pm)
Very interesting -- however, is this intended to be a 3D game or a 2D game?
#2
01/29/2007 (7:20 pm)
Right now I working on the basic widgets to support building these constructs on a 2D map, but release them into the 3D sim. The constructs will primarily be 2D in nature when running.
#3
01/30/2007 (1:13 am)
Thats pretty neat