Re: [A82: monster ai]


[Prev][Next][Index][Thread]

Re: [A82: monster ai]




This is how I would design it.

----- Original Message -----
From: Roger Levy <trip_n_save@hotmail.com>
<snip>

> Crawler (from metroid 1, but modified) crawls around the perimeter of any
> surface, up down, left and right, even upside down when needed. Its attack
> mode is it will switch directions if shot. If it gets shot while upside
down
> and sometimes (at random times) sideways it will fall off and crash to the
> ground. If it falls 7 or more blocks, it dies. Can be killed by one
missile.
> If shot in the air it gets hurt. Doesn't attack the player directly, but
has
> spines on the top that are dangerous.

For the Crawler:
 you will need a few temporary variables for him.
 direction = 0-up 1-right 3-down 2-left (NOTE: these are weird so you can
XOR %11 to change direction)
 xLocation = x position
 yLocation = y position

so we are talking about 8 sprites if you want to animate, and 4 if you want
to keep it simple.  i would reccomend animating the walking.

you would need to write some rudimentary collision detection routines (im
assuming that you are using 8x8 sprites)

they would detect when you were hit by the enemy, and when your bullets hit
them they would die, and they would detect how to climb up the rocks.

Climbing Up the rocks:
 the enemy would have to notice when it was approaching a rock or a hole in
its current path.
Then you would have to move Up/Down if you were going Left or Right OR if
you were moving Up/Down you would need to go Left/Right accordingly.  The
collision routine would handle this.

OTHER IDEAS:  if you are really lazy then you could make 4 specific map
sprites for the crawler, which would move autonomously in the map.  The
crawler would move by putting a blank space back in the map and moving 8
pixels at a time.  This would be jumpy so use it as a last resort.


I'll leave the shooter up to you, unless someone else on the list has a
great idea.

-harper



References: