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

Get help using Construct 2

Post » Sun Feb 22, 2015 3:22 pm

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.
Image
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.
B
20
S
5
Posts: 108
Reputation: 1,473

Post » Sun Feb 22, 2015 3:49 pm

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).
B
23
S
6
G
10
Posts: 1,041
Reputation: 7,553

Post » Mon Feb 23, 2015 1:36 am

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!
B
20
S
5
Posts: 108
Reputation: 1,473


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, valefor and 8 guests