Ludum Dare Principle

April 26th, 2017 5:30 pm

Game jams is not a best place to show your OOP patterns knowledge. And well, code written on LD has no chance to win «Best Architecture Ever» award. Just look at this God-object class of our Protolife game:

God object class on Ludum Dare

Class with ~1K lines and 26 dependencies? I would have a serious talk with myself about this code.

But good practices still make life easier even if they take longer. This is how we decided to define our micro-buildings. Here is a simple turret:

Protolife small turret

More powerful turret:

Protolife t3 turret

«d» means «blue block», «e» means «yellow block», capitalized letter means «anchor point», e.g. turret muzzle.

Yeah, hardcoding all the coords would be much simpler, but this pattern system allowed us to quickly add new buildings – as fast as we invented them. This part would be first candidate for DRYing – so we DRYed it.

Do you guys use the best practices in your code? SOLID? GRASP? Unit tests?

Tags: , ,


Leave a Reply

You must be logged in to post a comment.

[cache: storing page]