About 'Snap Defenders To Grid'!

In this video (objectives)...

  1. Use RoundToInt() to round our decimal places to whole numbers.
  2. Create a SnapToGrid() method which can then be used to return our final position for defenders.

After watching (learning outcomes)...

Snap our defenders to the grid using RoundToInt().

(Unique Video Reference: 22_GL_CUD)

We would love to know…

  • What you found good about this lecture?
  • What we could do better?

Remember that you can reply to this topic, or create a new topic. The easiest way to create a new topic is to follow the link in Resources. That way the topic will…

  • Be in the correct forum (for the course).
  • Be in the right sub-forum (for the section)
  • Have the correct lecture tag.

Enjoy your stay in our thriving community!

As I finished this episode I realized you can add several defenders to the same grid. In order to avoid that, I added a HashSet<> to my DefenderSpawner class.

Attaching my implementation as a reference

Privacy & Terms