{"author_name":"Volcanic Giraffe","cat":"LD #38","comments":[],"epoch":1493245800,"likes":1,"metadata":{"p_key":"180","p_author":"Volcanic Giraffe","p_authorkey":"111242","p_urlkey":"35014","p_title":"Ludum Dare Principle","p_cat":"LD #38","p_event":"LD38","p_time":"1493245800","p_likes":"1","p_comments":"0","p_status":"UPD5","us_key":"111242","us_name":"Volcanic Giraffe","us_username":"volcanicgiraffe","event_start":"1492732800","event_key":"69","event_name":"LD 38"},"text":"<p>Game jams is not a best place to show your OOP patterns knowledge. And well, code written on LD has no chance to win \u00abBest Architecture Ever\u00bb award. Just look at this God-object class of our <a href=\"https:\/\/ldjam.com\/events\/ludum-dare\/38\/protolife\" target=\"_blank\">Protolife game<\/a>:<\/p>\n <p><img src=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2017\/04\/VG-LD38-34.png\" alt=\"God object class on Ludum Dare\" \/><\/p>\n <p>Class with ~1K lines and 26 dependencies? I would have a serious talk with myself about this code.<\/p>\n <p>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:<\/p>\n <p><img class=\"aligncenter\" src=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2017\/04\/VG-LD38-37.png\" alt=\"Protolife small turret\" \/><\/p>\n <p>More powerful turret:<\/p>\n <p><img class=\"aligncenter\" src=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2017\/04\/VG-LD38-38.png\" alt=\"Protolife t3 turret\" \/><\/p>\n <p>\u00abd\u00bb means \u00abblue block\u00bb, \u00abe\u00bb means \u00abyellow block\u00bb, capitalized letter means \u00abanchor point\u00bb, e.g. turret muzzle.<\/p>\n <p>Yeah, hardcoding all the coords would be much simpler, but this pattern system allowed us to quickly add new buildings &#8211; as fast as we invented them. This part would be first candidate for DRYing &#8211; so we DRYed it.<\/p>\n <h3>Do you guys use the best practices in your code? SOLID? GRASP? Unit tests?<\/h3>\n \n <p>Tags: <a href=\"http:\/\/ludumdare.com\/compo\/tag\/ooc\/\" rel=\"tag\">ooc<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/programming\/\" rel=\"tag\">programming<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/solid\/\" rel=\"tag\">Solid<\/a><\/p>","time":"April 26th, 2017 5:30 pm","title":"Ludum Dare Principle"}