Fly Lines

One of the things I’ve always admired about games like Flappy Bird and Tiny Wings is that at their essence, they have a single control – touch the screen.

I LOVE that simplicity.

Now, so far, my control systems have been very keyboard oriented – or even keyboard+mouse, however, I’d like to get closer to that bare bones minimalism.

At this point, this just allows you to draw a whole bunch of lines on the screen. Like this:


Exciting, yes? I’m not sure where it’s going to go. I have very limited power (as far as I’m aware) given that I’m running inside Stencyl, but I’ll see if I can do anything interesting with it.

Alright, I’ve added different size lines. Which is.. mildly interesting? Dunno. I guess diff colours would be the next thing (although a lot fiddlier than diff line sizes). It bothers me that the lines are rounded on the end though. It’s not defined enough (but I can’t think of a clean way to sort that out). And really, what am I going to do in a day? Build a photoshop clone?

This happens. Getting lost in the middle of an unusual game design. I’m not too surprised by it. I’ll just keep plugging away. See what, if anything, comes out of it.

Ha, oh boy. Ok, this gets sillier. I figured out (quite quickly) an excellent algorithm for squaring those horrible rounded lines. Which works perfectly… unless the line is on an angle. Damn. So close. Well, the horizontal and vertical lines look excellent.

Wow, ok, trig. Ha, that brings back memories. I did a whole bunch of math. Nothing complicated, just fiddly, and lots of it. That got me as far as this:



Obviously the boxes are still a little large – however, the hard bit has been done – calculating the correct x,y relative positions for each of the four corners off each end of the line. In other words, the square box is on exactly the same angle as the line – hooray! Notice how by default the line is rounded? Yeah. *shudder* ugly. So, a little further on this:


Close, but still not quite right. A small revelation and voila:


Which is brilliant. Exactly the same width and orientation. Brilliant. Change the colours back and it now allows you to do neat things like this:


Which I’m sure someone of a vaguely artistic bent would be able to do something quite pretty with. Regardless, I’m happy enough with that. Plus, as a bonus, it was great to dust off some math I haven’t used in 20 odd years. Getting trig functions straight in my head will definitely be useful, since any placement, positioning or movement will use it. It’s going to come in handy, no question about it.