Android Unity Game Development Blog, Day 5: Git orf my land!

--

What I did

Today I focused on drawing an inner polgon at a 10% margin inside hexagons where a players army has been:

Looks simple huh?

What I learned:

The solution was so simple. It took me a half an our to dream up exactly what to do, and literally one line of code to implement it.

Basically the idea was, for each hexagon’s vertex, move them toward the center, but only by 10%.

This will also work for any set of vertices:

Vector3[] vertices = vertices.Select(v => Vector3.MoveTowards(v, center, 0.1f)).ToArray();

Viola! Done.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response