View Full Version: Help!!!

Game Maker > Questions and answers > Help!!!


Title: Help!!!
Description: I need help!!


NoReMaX - January 8, 2004 07:02 AM (GMT)
Im makin a game for the web site "Element Anime", and Im about 5% into the game, I got stuck!!!. So... Can anyone tell me a script for a AI Enemy that views from the top(birdeye view), I just need it face towards the oppent and shoot when its close enough,

Any help would be greatly appreactated (&Clap&)

Donovan_dcann - January 12, 2004 01:42 AM (GMT)
ok this is for a 360 rotating sprite and i have move the x,y origin of the sprite to the center
in cerate event
CODE
direction = 0;

step event
CODE
if distance_to_object(object1)<190
{
// Face the player
direction =point_direction(x,y,object1.x,object1.y);
//For the shooting
a=floor(random(25));
if a = 20
{
b=instance_create(x,y,objbullet);
b.direction = direction;
b.speed = 10;
sound_play(sound0);
}
}
else direction = 0;
image_single = direction/10;





Hosted for free by InvisionFree