Drawing Dashed Lines in Unity

with gl api

So before I start on the flight control logic, I need to make sure I can draw dashed lines in Unity. Of course you can use a prefab for the dashes, but this means creating thousands of game objects (alternatively you could draw the dash lines with a texture, but it’s not very different from using quads as I’ll show here.)

Drawing Lines with Unity

with the gl api

Before I move on to the next tutorial on Unity I need to cover a few things. Mainly, how to draw lines using Unity. I’ve decided to port the flight control tutorial I worked on a couple years ago to C# and Unity. And although it is not absolutely necessary to use the drawing API for that particular tutorial, it wouldn’t be as much fun without it.

Dots and Lines: The AI

in unity

Adding an AI player to the game couldn’t be simpler, really. I add a class called ComputerPlayer and I end up using all the same handlers the “human” player uses: HandleTouchDown, HandleTouchMove and HandleTouchUp.

Puzzle Game: Dots and Lines

in unity

This next game is a version of something I used to play when I was a kid but never knew the name for it. You might have played this as well. Basically you draw a grid of dots on a piece of paper. Then two or more players alternate connecting two adjacent dots with a line until you form a square. Squares mean points! So in other words, a kind of tic tac toe.

Rock Paper Scissors Lizard Spock 2

in unity

Now for the second version of Rock Paper Scissors Lizard Spock. This time a puzzle game. The objective is to clear the grid completely, but you can only select tiles by beating them in Rock Paper Scissors… fashion.