{"author_name":"oolealealealea","cat":"October Challenge 2013","comments":[{"author_name":"","time":"October 5, 2013 3:58 am","epoch":1380963480,"text":"I wonder what&#8217;s the best way to include source code snippets in the posts?","spam":"N"}],"epoch":1380963420,"likes":0,"metadata":{"p_key":"37789","p_author":"oolealealealea","p_authorkey":"505330","p_urlkey":"73405","p_title":"Day 6: First aliens and screen orientation","p_cat":"October Challenge 2013","p_event":"LD27","p_time":"1380963420","p_likes":"0","p_comments":"1","p_status":"UPD5","us_key":"505330","us_name":"oolealealealea","us_username":"oolealealealea","event_start":"1377216000","event_key":"18","event_name":"LD27"},"text":"<p>OK, I got some really retro aliens, and they are flying around. Sorry for no demo, it&#8217;s an Android game, all I got is .apk and you probably wouldn&#8217;t want to install .apk from a complete stranger. Basically, the background loads, and stars load, and stars slowly move. To scroll the stars I&#8217;m using setV() and setV2() on the stars texture, slowly increasing the timer. Like this:<\/p>\n <p><code>scrollTimer -= delta*0.014;<br \/>\n if (scrollTimer &lt; 0.0f)<br \/>\n scrollTimer = 1.0f;<br \/>\n sStars.setV(scrollTimer);<br \/>\n sStars.setV2(scrollTimer+1);<\/code><\/p>\n <p>And then some aliens show up and they move to the right. That&#8217;s about all that works now. I&#8217;m still learning libGDX, so a lot of time goes into googling and reading tutorials or watching videos.<\/p>\n <p>Helpful tip: I noticed that some games built with libGDX have fixed screen orientation. If you flip the device, the game shows upside-down. I found a very simple solution to this in some obscure comment in some SO thread. Just replace <b>landscape<\/b> with <b>sensorLandscape<\/b> in AndroidManifest.xml and device flips the screen automatically.<\/p>\n <p><img alt=\"\" src=\"http:\/\/bigosaur.com\/blog\/images\/eclipse.jpg\" \/><\/p>\n <p>(Copied from my <a title=\"Bigosaur Blog\" href=\"http:\/\/bigosaur.com\/blog\/\">blog<\/a>)<\/p>","time":"October 5th, 2013 3:57 am","title":"Day 6: First aliens and screen orientation"}