Need movement code for my dragon

Posted by mazimadu on July 3, 2010, 11:49 a.m.

WARNING: The following was copy pasted from the gmc, so forgive my blatant froum language

Hi guys. I need a little help with a game I am making. You see I am making a game where you have to fight a dragon by climbing to its head. So far I have the movement, attacks, and grapple code implemented; as seen below:

Right now the dragon is following the mouse. I am trying to make the dragon follow a predetermined path that changes based on the players location. Basically, I want the dragon to:

1. Move in a wavy motion left and right of the screen.

2. Slightly dive down to fire a fireball, then return to 1.

3. If the player is on it, move upwards and make a loop-de-loop.

4. If the player is really close to the head, avoid flying to 3 specific points on the screen.

All the while, speed is constant.

If you have Game maker 8(registered), you can try implementing your code with this stripped down version of the dragon.

http://www.box.net/shared/vs02xaz7im

If you can help out please reply this post. :)

Comments

Avenger 14 years, 4 months ago

The only thing I could think of is to use paths, both relevant and absolute. It wouldn't be perfect, but it would make it predictable - which bosses usually are in good games (sometimes). You would need a path for each of the circumstances.

mazimadu 14 years, 4 months ago

Tried it, this wouldn't work as well.

For "1" paths work fine, but when it comes to moving from one state to another, the movement gets really jerky.

Also the head is not on the path, it follows an object(or rather, an object that follows the mouse). If the head where to follow the path, it would be unable to move anywhere else.

Juju 14 years, 4 months ago

Look at the problem mathematically. Paths are a waste of time.

mazimadu 14 years, 4 months ago

@Cyrus

That boss used paths. Mine is going to have more in common with Colossus 13 from Shadow of the Colossus (http://www.youtube.com/watch?v=Z0W6oWgARSE).

OBELISK 14 years, 4 months ago

I'm stealing the GM file you provided. I've been looking for this for years.

Ferret 14 years, 4 months ago

Your dragon's hands look like he is Italian and talking about the meatballs on his mothers pasta.

Avenger 14 years, 4 months ago

Its true. O_o

SteveKB 14 years, 4 months ago

make the dragon follow an object moving in a path and make the object only move when the dragon is close by. this is a bit messy but it will work for smooth transitions.

Kaz 14 years, 4 months ago

lmfao Ferret

mazimadu 14 years, 4 months ago

@Ferret

Indeed lol.

@meow44

I actually thought of that. Is it possible to make the path object stop under certain conditions? That way, the dragon can deviate from the path a little and then return.