Bigosaur blog

Day 6: First aliens and screen orientation

OK, I got some really retro aliens, and they are flying around. Sorry for no demo, it's an Android game, all I got is .apk and you probably wouldn'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'm using setV() and setV2() on the stars texture, slowly increasing the timer. Like this:

    scrollTimer -= delta*0.014;
    if (scrollTimer < 0.0f)
        scrollTimer = 1.0f;

And then some aliens show up and they move to the right. That's about all that works now. I'm still learning libGDX, so a lot of time goes into googling and reading tutorials or watching videos.

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 landscape with sensorLandscape in AndroidManifest.xml and device flips the screen automatically.

Setting up Eclipse for libGDX and Android

read more...   Bigosaur, 2013-10-05

<< Day 5: libGDX and graphics ideas

Day 7: Change of layout and screen orientation >>

Son of a Witch | SoaW graphics, screenshots and .gifs Website Home Page Website Home Page Blog main page YouTube channel Twitter account Google+ page Facebook page