{"id":178,"date":"2009-11-07T21:56:11","date_gmt":"2009-11-07T20:56:11","guid":{"rendered":"http:\/\/www.puppygames.net\/blog\/?p=178"},"modified":"2009-11-07T21:56:11","modified_gmt":"2009-11-07T20:56:11","slug":"steaming-puppy-pumps-cool-hot-turrets","status":"publish","type":"post","link":"https:\/\/www.puppygames.net\/blog\/?p=178","title":{"rendered":"Steaming Puppy pumps cool hot turrets!"},"content":{"rendered":"<p>Here&#8217;s an example of the colouring system we&#8217;re using in Titan Attacks 2 &#8211; Revenge of the Titans. In this case as applied to a cooling tower, a player building that cools down your overheating turrets. It&#8217;s a common problem. Building a load of these little fellas nearby though can increase their fire rate.<\/p>\n<p>Here we have the cooling tower as it looks with colours applied in two schemes &#8211; night and desert. On the left we have the Colour Diddler which lets us fidddle away with the level palettes as the game is running. Neat eh?<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"margin: 15px 0px;\" title=\"revenge-of-the-titans-cooling-tower-1\" src=\"https:\/\/www.puppygames.net\/blog\/wp-content\/uploads\/revenge-of-the-titans-cooling-tower-1.jpg\" alt=\"\" width=\"640\" height=\"480\" \/><\/p>\n<p>So how this all work then?<\/p>\n<p>The cooling tower is a collection of static sprites, animated sprites and emitters. The sprites, mostly white, can be coloured by the level palettes, and then this colour is affected by an attenuation colour and % the further from the center of the level they are &#8211; black in the case of the nighttime level, and a subtle red tint for the desert level colour scheme. Here&#8217;s the various sprites&#8230;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"margin: 15px 0px;\" title=\"revenge-of-the-titans-cooling-tower-2\" src=\"https:\/\/www.puppygames.net\/blog\/wp-content\/uploads\/revenge-of-the-titans-cooling-tower-23.jpg\" alt=\"\" width=\"640\" height=\"421\" \/><\/p>\n<p>First of all we have the base. This defines the bounds of the building making it easier to tell where the player can build things and distinguishes player buildings from other stuff going on. All buildings and monsters and trees and things are drawn from the front, but the map is actually viewed from above which is perhaps a bit of an odd way to do things, but it&#8217;s a lot easier to draw poo like that. The next sprite, the shadow, also helps in making the flat front-on sprite look like it&#8217;s sitting on the ground and not just floating about in space.<\/p>\n<p>That little black rectangle sits behind the main sprite animation. Inbetween these is an emitter that pumps out steam. This way the steam looks more like it&#8217;s coming out of the cooling tower rather than just from behind it. It&#8217;s hardly noticeable really. Maybe got a bit carried away there.<\/p>\n<p>The main sprite, unlike the others, has two colours applied to it &#8211; a top and a bottom colour &#8211; applied as a gradient to the sprite. The top colour is specific to buildings, and the bottom is a general &#8216;floor fog&#8217; colour which is applied to almost everything &#8211; buildings and monsters and trees etc. This helps in the illusion of the flat building existing in the world space wotsit. It also means if buildings overlap vertically there will be a bit of colour difference between them, making it easier to tell them apart.<\/p>\n<p>Next up is the overlay sprite &#8211; this is about 50% transparent and is not affected by the level&#8217;s attenuation, meaning it&#8217;ll seem like it&#8217;s a bit glowy or reflective. Then finally on top of all that is the little glowing light animation that is synched up with the pumpy animation of the tower and the steam emitter. This sprite is neither coloured nor affected by the attenuation colour, so it&#8217;s always going to be a bright orangey red light thang.<\/p>\n<p>&#8230;and if you&#8217;re really interested or just having trouble sleeping here&#8217;s how the cooling tower appearance is defined in xml&#8230;<\/p>\n<p><code>&lt;sprite layer=\"4\" sublayer=\"1\" colored=\"floor\" attenuated=\"true\" image=\"spriteimage.generic.2x2.base.01\"\/&gt;<br \/>\n&lt;sprite layer=\"4\" sublayer=\"2\" colored=\"shadow\" attenuated=\"true\" image=\"spriteimage.generic.cooling.ground.01\"\/&gt;<br \/>\n&lt;sprite layer=\"5\" sublayer=\"1\" colored=\"buildings\" attenuated=\"true\" animation=\"generic.cooling.back.animation\"\/&gt;<br \/>\n&lt;emitter offset=\"25,0\" emitter=\"steam.burst.emitter\"\/&gt;<br \/>\n&lt;sprite layer=\"5\" sublayer=\"3\" bottomColored=\"floor-fog\" topColored=\"buildings\" attenuated=\"true\" animation=\"generic.cooling.animation\"\/&gt;<br \/>\n&lt;sprite layer=\"5\" sublayer=\"4\" colored=\"buildings-alt\" attenuated=\"false\" animation=\"generic.cooling.top.animation\"\/&gt;<br \/>\n&lt;sprite layer=\"5\" sublayer=\"5\" animation=\"generic.cooling.glow.animation\"\/&gt;<\/code><\/p>\n<p>Phew. Any questions? Anyone still awake?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s an example of the colouring system we&#8217;re using in Titan Attacks 2 &#8211; Revenge of the Titans. In this case as applied to a cooling tower, a player building that cools down your overheating turrets. It&#8217;s a common problem. Building a load of these little fellas nearby though can increase their fire rate. Here [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[18],"class_list":["post-178","post","type-post","status-publish","format-standard","hentry","category-diary","tag-revenge-of-the-titans"],"_links":{"self":[{"href":"https:\/\/www.puppygames.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/178"}],"collection":[{"href":"https:\/\/www.puppygames.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.puppygames.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.puppygames.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.puppygames.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=178"}],"version-history":[{"count":9,"href":"https:\/\/www.puppygames.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/178\/revisions"}],"predecessor-version":[{"id":195,"href":"https:\/\/www.puppygames.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/178\/revisions\/195"}],"wp:attachment":[{"href":"https:\/\/www.puppygames.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.puppygames.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=178"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.puppygames.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}