Day 5 of my Developer Journey: Simple Enemy behavior

Now that we a mostly functioning player, we need to create a simple enemy script. This consists of the enemy moving down to the bottom of the screen once it spawns and then once it goes off screen, reappear at the top of the screen at a random location.

Enemy behavior Script

The random number generator may be used in two ways:

  1. Directly in the code
Random Number directly used for the Vector Value
  1. Implemented through a variable.
Random Number through a variable

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