A retro-esce zone-based enemy position reset system?

0 favourites
  • 3 posts
From the Asset Store
Be discreet and rescue your friends from behind enemy lines.
  • That was the best title I could come up with, what I'm trying to shoot for needs some explaining:

    My game is a platformer. A player moves and transitions across fixed camera zones. Like Shovel Knight, Mega Man, etc.

    So far, everything has been going great, but I've been stuck here; I have enemies, and I have these zones. Some enemies are triggered through LOS behaviors. Now the problem is that I don't want some enemies to be "active" until the player is in the same active zone as the enemy.

    This has been really difficult to make when I have multiple versions of the same "Red" enemy.

    Imagine here, that the green boarders are the camera zone markers, the blue is the player and the red are the enemies. Keep in mind the screen is the size of one green boarder.

    Any attempts that get close to replicating what I'm trying to get poses an even bigger issue: Going back to the zone.

    Let's say the player kills one of the red enemies in the left camera zone, and then moves to the right camera zone. Now, when the player goes back into the left camera zone, the enemy is either frozen in place, waiting at the entrance unfairly, or teleports to the right zone on the player entering the left zone.

    Not only do the enemies have to stay "disabled" until the player reaches the active zone, but the either the unkilled enemies, or possibly all of a zone's enemies need to "reset" to their starting positions and state upon re-entering a zone the Player has already been through.

    Has anyone worked on a system similar to what I'm describing? I'd really appreciate the help since this is one of the important systems I need to tackle and have been stuck on it for 2 days now. If you need any additional info let me know.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You could add an array to the zones (container), which stores the enemy information (position, type...) on startup.

    Now when a zone is entered, you can spawn the enemies from the array. Simple as that.

    There might be some inconvenience because you cannot spawn objects by name, but that is something you have to work around in C2 quite regularly (there is a plugin I think it's called "nickname" that can help with that too).

  • I think I've found a solution that works for me but I've never thought of Arrays and I'll keep them in mind, thanks!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)