Jump to content


Sonicdog999

Member Since 27 Nov 2009
Offline Last Active Jun 16 2010 10:11 PM

Posts I've Made

In Topic: Help With My Pacman Game

06 February 2010 - 04:30 PM

[quote name='JoeFCards' post='2848623' date='Aug 31 2008, 02:44 AM'][quote name='Dangerous_Dave' post='2848441' date='Aug 30 2008, 03:55 PM']Thats the script to add your AI to. Something like this will make the ghosts chase pacman:

{  if (hspeed == 0)  {    if (x > Player.x && place_free(x-global.setghost,y))    {       hspeed = global.setghost; vspeed = 0;    }    else if ( place_free(x+global.setghost,y))    {       hspeed = -global.setghost; vspeed = 0;    }  }   else  {    if (y > Player.y && place_free(x,y-global.setghost))    {      hspeed = 0; vspeed = global.setghost;    }    else if (place_free(x,y+global.setghost))    {       hspeed = 0; vspeed = -global.setghost;    }  }}
Then at the end of each ghosts' step event, put this--
if scared = true{Adapt_direction_scared()speed = global.setghost/2}
Also, if you want the ghosts to slow down when they're blue, put this codebox at the end of the ghosts' collision event with Wall and Gate objects.
if scared = true{speed = global.setghost/2}
Try it and tell me if it works

In Topic: Tower Defense Game Tutorial

18 December 2009 - 09:16 PM

is there any way to remove the time system and transfer it to a START button so you have plenty of time to buy/upgrade weapons and start the round whenever you want?
just wondering. :)