Multiple Enemies

Scripting help, tricks, and tips. How to use the editor.
Post Reply
Mouzi
Posts: 153
Joined: Sat Sep 01, 2007 5:34 am
Location: Finland
Contact:

Multiple Enemies

Post by Mouzi »

See the example level Multiple Enemies (it has infinite lives because it's just an example).

I bet someone has better use for this than I do :P I'm not that good with action levels.

Here's the designing code for it:

Code: Select all

AI code

AI_makeTrigger,death,rotatePart,6,1,5,0,0,90
AI_makeTrigger,death,rotatePart,6,1,-5,85,0,90
AI_makeTrigger,death,rotatePart,7,1,5,0,0,180
AI_makeTrigger,death,rotatePart,7,1,-5,85,0,180
AI_makeTrigger,death,rotatePart,8,1,5,0,0,270
AI_makeTrigger,death,rotatePart,8,1,-5,85,0,270


Part code

core, 400, 300, 0, 1, 1, -1, 0, 0066FF
rect, -145, 175, 0, 1, 1, e0, 8, 0066FF
rect, -292, 8, 0, 1, 1, e0, 7, 0066FF
rect, -291, 170, 0, 1, 1, e0, 6, 0066FF
c, 0, -100, 0, 1, 1, e0, 1, 0066FF
c, 100, 0, 0, 1, 1, e1, 5, FFFF00
c, 0, 100, 0, 1, 1, e1, 4, FF0000
c, 0, -100, 0, 1, 1, e1, 3, 0000FF
c, -100, 0, 0, 1, 1, e1, 2, 00FF00
The squares are a way to skip to next enemy easily when designing.
You have to change the -100 and 100 in the five Plain circle parts to for example -1000 and 1000 when you want to finish it.

Discuss :)
swartzer
Posts: 144
Joined: Sun Oct 21, 2007 1:38 pm

Post by swartzer »

Once again, Mouzi with the cool new technique! This is pretty slick.
Sasadad
Posts: 109
Joined: Wed Jan 02, 2008 1:23 pm
Location: Over there... no, a little to the left
Contact:

Post by Sasadad »

Whoa. I don't get how you did it, but that is amazing. Probably the coolest thing I've seen yet on ZF. :)
Mouzi
Posts: 153
Joined: Sat Sep 01, 2007 5:34 am
Location: Finland
Contact:

Post by Mouzi »

I did it with the new deathTrigger: rotatePart.
When one enemy dies a new one rotates into view and starts shooting.

I've been thinking about something like this before and I think I've posted about it too, but it probably wasn't possible before now.

EDIT: Found it
Mouzi wrote:Some cool uses for this would be for example a survival level where you have to survive for something like 1-2 minutes and then the level would change. Or then I had an idea about a level with maybe 3 different ships where only one of them is visible and then the visible one would change with certain interval.
There was some discussion about it in this thread too.
Sasadad
Posts: 109
Joined: Wed Jan 02, 2008 1:23 pm
Location: Over there... no, a little to the left
Contact:

Post by Sasadad »

How does the new ship rotate to exactly where the old one was? Are they all attached to a core in the center that is randomrotating and randomwaypoint-ing?
Mouzi
Posts: 153
Joined: Sat Sep 01, 2007 5:34 am
Location: Finland
Contact:

Post by Mouzi »

The enemies are attached to a circle and rotate around it and that circle is attached to the core.

Did you try the code I posted? It should explain it a bit as it is a small scale version of the level (before you change the -100 and 100 to -1000 and 1000).
swartzer
Posts: 144
Joined: Sun Oct 21, 2007 1:38 pm

Post by swartzer »

You could probably accomplish the same effect by locating the core off the top of the screen and the multiple enemies in a wide circle around it. Every time an enemy is destroyed, the core would rotate to bring a new enemy into the exact center of the screen. The last enemy, instead of having a rotation trigger when destroyed, would have a destruction trigger to blow up the core and end the level.
Mouzi
Posts: 153
Joined: Sat Sep 01, 2007 5:34 am
Location: Finland
Contact:

Post by Mouzi »

Yeah, but then you can't make it move/rotate randomly or follow ship.

That's why I put the circle as the center and not the core.

It still looks exactly the same so why not? :P

(Actually I made it first that way, with the core off screen, but then I realised
I couldn't put randomWaypoints nor randomRotate on it so I had to make a workaround.)
swartzer
Posts: 144
Joined: Sun Oct 21, 2007 1:38 pm

Post by swartzer »

Good point! I hadn't thought of the effect my version would have on boss movement.
Sasadad
Posts: 109
Joined: Wed Jan 02, 2008 1:23 pm
Location: Over there... no, a little to the left
Contact:

Post by Sasadad »

Ok, cool. So now I get how it works perfectly. Would you mind if I made a level based on this, Mouzi?
Mouzi
Posts: 153
Joined: Sat Sep 01, 2007 5:34 am
Location: Finland
Contact:

Post by Mouzi »

Sasadad wrote:Would you mind if I made a level based on this, Mouzi?
No. That's why I posted the code; for others to use in their levels :)
Post Reply