Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Help!
#1

Making a floating enemy move left and right and fire projectiles

Archive: 6 posts


I'm doing a mid-boss fight with an enemy that is supposed to hover above the player and move left and right within a set distance. I'm trying to figure out how to signal it to move in the opposite direction when it reaches a wall. I'm guessing tags and tag sensors will be involved hooked up to the mover, but I'm not sure what type of mover and settings to use.

Also, is there a way to change up the way it fires lasers like I'm planning? I've added an emitter to its' bottom that shoots them downward, but I want it to be able to randomly shoot diagonally downward left and right as well.

EDIT: Forgot to mention: Is there a way to put three emitters behind one another on each layer of a three layer object, so you can't simply change layers to dodge every projectile?
2011-09-12 21:14:00

Author:
Behonkiss
Posts: 229


Hey Behonkiss,

Is the enemy supposed to follow right on top of the player? If you use a follower tweaked to disable up/down movement with a strength of about 80% (so it's not perfectly on top of you at all times), it should produce a fairly realistic following enemy. I'd have to get back to you on moving the other direction upon reaching a wall. It's not overly complicated, but I'm unsure of the exact method to go about it or how to explain it at this time.

As for the emitters, you can put 3 different emitters on a chip that emit the same laser object, just on a different layer. You could use a randomizer every time the laser event is triggered, randomly picking one of 3 different emitters, each with different "angles" of laser.
2011-09-12 21:44:00

Author:
xero
Posts: 2419


Is the enemy supposed to follow right on top of the player?

No, it's just supposed to move left and right repeatedly in a set motion. This is the first boss I've ever done and is just the mid-level boss anyway, so it doesn't need to be super-complex.
2011-09-12 23:05:00

Author:
Behonkiss
Posts: 229


to do the left/right motion.

Put an impact sensor on your boss set to detect tag and allow touching. Put that tag on your left and right walls.

Run your impact sensor into the cycle input of a selector with two inputs/outputs on it. Run each of the outputs into a direction combiner and then put that combiner into the left/right input of your mover.

Every time the boss hits a wall, it will cycle the selector. That changes the output on the direction combiner and reverses the direction it is moving.
2011-09-12 23:14:00

Author:
tdarb
Posts: 689


Make a selector with two outputs. Put a tag on each wall. Make a tag sensor with the appropriate radius, so that when it comes into radius of either tag it switches direction. Wire each selector output to a mover set to left or right; same speed, just opposite integers. To change up the way it fires lasers, you want to make a randomizer with your desired times (could even be the same time for minimum and maximum, so it fires at a constant interval) and wire the randomizer to each laser direction. If you want to make one direction theoretically shoot more often than others, you have to copy each emitter to simulate the frequency of each direction. For example, if you have 1 left, 1 right, and 1 middle, the middle will fire 1/3 of the time. But if you have 1 left, 1 right, and 2 middles, the middle will fire 1/2 of the time. This is nearly exactly what the first stage of my 3-stage boss fight is, except he takes a small break every 15-20 seconds to fly to the middle of the level and allow you to shoot him for 5 seconds.2011-09-12 23:16:00

Author:
nunsmasher
Posts: 247


No, it's just supposed to move left and right repeatedly in a set motion. This is the first boss I've ever done and is just the mid-level boss anyway, so it doesn't need to be super-complex.

Ah! I read the OP wrong, and I understand now. This is easy!

tdarb nailed it down pretty well, if you follow the instructions in his post you should get desirable results.
2011-09-12 23:32:00

Author:
xero
Posts: 2419


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.