{"assets":[{"original":"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2013\/08\/basecode.png","local":"\/data\/posts\/2013\/08\/bcc4c3e43407a0d5b07248245617ac0e.png"},{"original":"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2013\/08\/warmup.gif","local":"\/data\/posts\/2013\/08\/3c285096fb1e510049c028b3bcd77c00.gif"}],"author_link":"author\/rxi\/","author_name":"rxi","cat":"LD #27","categories":["LD #27"],"comments":[],"epoch":1376808960,"event":"LD27","likes":13,"metadata":{"p_key":"80826","p_author":"rxi","p_authorkey":"0","p_urlkey":"289943","p_title":"Base code","p_cat":"LD #27","p_event":"LD27","p_time":"1376808960","p_likes":"13","p_comments":"0","p_status":"WAYBACK","us_key":null,"us_name":null,"us_username":null,"event_start":"1377216000","event_key":"18","event_name":"LD27"},"source_url":"2013\/08\/18\/base-code-7\/","text":"<p><a href=\"http:\/\/www.ludumdare.com\/compo\/2013\/08\/18\/base-code-7\/basecode-2\/\" rel=\"attachment wp-att-266755\"><img alt=\"basecode\" class=\"aligncenter size-full wp-image-266755\" height=\"287\" sizes=\"(max-width: 287px) 100vw, 287px\" src=\"\/data\/posts\/2013\/08\/bcc4c3e43407a0d5b07248245617ac0e.png\" srcset=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2013\/08\/basecode-150x150.png 150w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2013\/08\/basecode.png 287w\" width=\"287\"\/><\/a><\/p>\n<p>This will be the first Ludum Dare where I won\u2019t be using C, and have instead opted for Haxe and NME which, through recent usage, I\u2019ve found quite lovely. It\u2019ll be interesting to see how different this game turns out given I won\u2019t have to deal with some elusive segfault and the 5 hours it takes to track down, or an alignment issue in my bitmap loading.<\/p>\n<p>I\u2019ve written a small amount of base code to cover a few of the most tedious things I imagine I\u2019ll have to deal with. I\u2019ve tried to keep it quite minimal, though, as not to influence any game mechanics\/decisions before the competition, leaving me free to try whatever I want \u2014 for example, in not wrapping sound handling it leaves me free to code the sound synthesis all from scratch (I did this during LD24\/LD25), and in not having collision detection it leaves me free to experiment with different collision techniques. I\u2019ll probably hack away at the base code itself as I go along, and some I probably won\u2019t touch at all.<\/p>\n<p>The base code can be <a href=\"http:\/\/dl.dropboxusercontent.com\/u\/36451301\/ld\/ld27\/basecode.zip\">found here<\/a> and consists of the following:<\/p>\n<p>\u00a0<\/p>\n<p><strong>ld.Game<\/strong><\/p>\n<p>Provides a BitmapData buffer for putting the game\u2019s pixel in. Also handles setting the elapsed time after each frame, and provides update() and draw() functions for overriding. Provides a console for outputting debug stuff.<\/p>\n<p>\u00a0<br\/>\n<strong>ld.Preloader<\/strong><\/p>\n<p>A fancy preloader.<\/p>\n<p>\u00a0<br\/>\n<strong>ld.Tween<\/strong><\/p>\n<p>The bare essentials for handling tweening.<\/p>\n<p>\u00a0<br\/>\n<strong>ld.Input<\/strong><\/p>\n<p>Handles mouse and keyboard input events and provides functions for checking the state of the keys\/mouse button and checking whether the keys\/mouse was just pressed on this frame or not.<\/p>\n<p>\u00a0<br\/>\n<strong>ld.Rect<\/strong><\/p>\n<p>Represents a rectangle. Has inline functions for returning the top\/left\/bottom\/right\/middle of the rectangle, which is always useful and makes dealing with rectangles (which I often make ample use of) a lot less tedious.<\/p>\n<p>\u00a0<br\/>\n<strong>ld.Timer<\/strong><\/p>\n<p>Handles the delayed calling of function after a number of seconds, or the repeated calling of functions on a timer. This will be something I will rely on for all my timers, which is a deviation from simply using floats which count down to zero on each frame.<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p><a href=\"http:\/\/www.ludumdare.com\/compo\/2013\/08\/18\/base-code-7\/warmup-9\/\" rel=\"attachment wp-att-266762\"><img alt=\"warmup\" class=\"aligncenter size-full wp-image-266762\" height=\"255\" src=\"\/data\/posts\/2013\/08\/3c285096fb1e510049c028b3bcd77c00.gif\" width=\"393\"\/><\/a><\/p>\n<p>To test the base code I also wrote a terrible warm up game last night. Play at your own risk:<\/p>\n<p><a href=\"http:\/\/www.ludumdare.com\/compo\/ludum-dare-27-warmup\/?action=preview&amp;uid=16007\">http:\/\/www.ludumdare.com\/compo\/ludum-dare-27-warmup\/?action=preview&amp;uid=16007<\/a><\/p>","time":"August 18th, 2013 6:56 am","title":"Base code","title_was_empty":false}