PDA

View Full Version : chained Enemies


Opera_Ghost
01-03-2009, 05:47 AM
Hi im working on a zelda like game at the moment I have small enemies but I want to make larger ones like the ones made from the circles. for those of you who dont know what i mean here is a classic boss fight from a Zelda game, the boss is Lanmola here is the link

http://au.youtube.com/watch?v=KTu7ZICF3Og

As you can see the monster is made out of parts which are connected, the monster i want to make follows this idea I have tried using a basic AI to make each part follow the other.

if (this._x<(_root.part2._x-1) && (_root.BG.hitTest(_x+4, _y, true))) {
this._x += 2;
}
if (this._x>(_root.part2._x+1) && (_root.BG.hitTest(_x-4, _y, true))) {
this._x -= 2;
}
if (this._y<(_root.part2._y-1) && (_root.BG.hitTest(_x, _y+4, true))) {
this._y += 2;
}
if (this._y>(_root.part2._y+1) && (_root.BG.hitTest(_x, _y-4, true))) {
this._y -= 2;

and so on, this works well untill the player stays still making the parts stake and can never be put back to normal, plus my monster cant move past objects well half the body follows but the other half takes short cuts. Im at a lose and cant think of anything that will solve my issue. thanks for the help in advance.

rrh
01-07-2009, 04:51 PM
Look up "inverse kinematics." There might be a solution there.

Opera_Ghost
01-07-2009, 08:28 PM
thanks ill look at it now