Friday, May 29, 2015

Friday, 29 May 2015

Today has been the most frustrating day so far with the programming. I've always said Fridays were the worst day of the week.

First off I tried to draw a cursor on screen that sits on the edge of your screen pointing to off screen objects. After the better part of 2 hours, I decided to give it a break and work on something else.

Managed to get a simple line drawn between two objects (as you can see in the screen shot, between star and ship). Then proceeded to add orbit circles, which worked fine until I realised that as soon as I scale them up to increase the radius, the line width increases because I'm setting the width in local coordinates and not in screen coordinates.

Anyhow, after much fiddling around (i.e. googling answers to similar questsions), I found a solution that kept the orbit circle the same thickness, except now I couldn't increase or decrease it. Oh well.

I then noticed that the anti-aliasing on my amazing Bezier curve planet wasn't resolution independent (related to previous problem), and I managed to fix that up in less than a minute, luckily without any side effects.

Then, back to the off screen cursor. After much cursing I finally got to position it in the right place. I then started to work on rotating the cursor (an arrow), only to discover I can't rotate the built in GUI sprites, I have to muck around with rotating the entire canvas (or something to that effect), drawing a dynamically created texture, and then rotating the canvas back.

In the end, I managed to get it to work close enough. I wanted it to hug the edge of the screen, but it's orbiting the ship at half the screen height so it's okay I guess.

Hopefully I'll have less frustration and more productivity tomorrow.

Edit: Forgot to mention that at some point I implemented the basic built-in engine trails. Need to adapt them to react to the user flying forward, because currently they look really dumb when reversing (wait, why does my spaceship reverse as fast as it flies forward?) and when turning in tight circles.