Tetris Anyone?

by Bron Skinner 3. October 2009 07:10
So I’ve decided to forgo the Custom Silverlight Button route for the meantime and instead pursue a Tetris based game. I believe it will be a relatively easy challenge that will open the doors to more challenging game emulations if not completely new custom game creations.

**Update 10/3/09** Development is going well for this project. I have a matrix based system for determining block coords, shapes, and statuses. Currently shape definitions for the seven basic Tetris shapes are available, each with 2 - 4 position matrices. The application seems to be running smoothly with the existing logic. I hope to have a working model (with music the original music as well as other cool selections ;) ) in the next day or so as well as a technical article describing the logic in depth.

**Update 2 10/4/09** Didn't realize how much tougher managing my application code for this app would be. I have solid conceptual logic, and most of it's been implemented already - but actually managing all the peices after they expand outward enough...I've still not managed to find a good way to overcome this. I know Visual Studio has class diagrams, perhaps simply keeping detailed notes with a global diagram will suffice.

**Update 3 10/7/09** Alright, a lot of progress has been made since my last update. I've got a menu system finished, audio setup, a few new graphics and I've fixed the Block Rotate bug I found earlier. I've got a few more items to implement such as general testing (which I'm looking forward to despite the faults I'm sure will be found), blockID implementation that will ensure that free fall blocks (unsupported blocks seperated as a result of a row(s) clear) only remain supported by blocks with the same blockID instead of (what is now implemented) simply looking for a block of the same color in the left/up/right adjacent cell and assuming =P. I've also got to add a few animation sequences for score multipliers acheived during gameplay as well as sounds and sequences for actual row clears. Currently they just dissapear and your score is adjusted. I'll also be writing up a more detailed user manual going over the specifics for score calculations and including a link in the how to play section in the game itself. I'd also like to add a projected block graphic (flashing outline) indicating where your block with it's current path will end up. This will be doable, but will present another unique challenge in itself.

My biggest conscern throughout this entire project has been reducing total loops. Currently the app is somewhat loop heavy, but I have yet to see any performance degredation on my machine. Testing on multiple machines of different performance levels will be interesting. I know that many machines (even newer ones can have issues running Silverlight applications that are medium-heavy on the animation side.



I have a strong desire to build a 3d engine in Silverlight. I’ve been doing a little research on methodology already used as well as a little in house (head) thinking. It appears that the best method for accomplishing this is to first create a few simple shapes, a cube among other simple polygons, and figure out the basic algorithms I’d have to use to plot the non front facing accompanying polygons that placed appropriately would give the appearance of the 3d shape. Modifying this algorithm to take a directional set of data would allow me to calculate new dimensions for each polygon.

Using this as a model, I would then like to create a similar set of algorithms that would be used to calculate gradient fills (shading) and then possible (external) gradient fills (external lighting effects). I assume that I will rely heavily on gradient (radial in nature) and lighting effects in giving sphere’s 3d appearances.

More complex shapes such as custom models (e.g. two sphere joined by a rod) will require more complex algorithms…or perhaps just the conjunctive use of multiple single shape calculations….but no, in order for shading and lighting to affect the entire shape with fluidity, we will need to take into account the entire shape as a single unit. I’ll have to give this more thought. Starting small, however, I will work to create a cube and give it 3d rotational movement. I encourage you to see the last application I uploaded (Silverlight Fractal) and play around with it a little.

Tags:

Technical

Comments

6/30/2010 4:42:44 AM #

Searching for this for some time now - i guess luck is more advanced than search engines

over the knee socks United States |

6/30/2010 10:45:40 AM #

I never thought of that this way .. good writing.

stress fracture foot United States |

6/30/2010 6:14:54 PM #

Great concepts on this website. It's rare these days to find websites with data you are seeking. I am happy I chanced on this webpage. I will certainly bookmark it or even register for your rss feeds simply to be updated on your new posts. Thank you!

Prison Break TV United States |

Powered by BlogEngine.NET 1.5.0.7
Custom theme for digitalboon.com by Bron Skinner

About the author

A Software Developer with a keen artistic sense, I’ve spent the last couple years working with predominantly Microsoft-based technologies developing web applications. The majority of this time has been spent building applications with SilverlightTM that forward some rather unique approaches to interface design. I am currently working full time.

 

 

Make sure to check out The Forge.


Download Resume