Ok, I see your problem. In your code you have this:
- Code: Select all
if(distance(player.x, player.y, Al.x, Al.y) <= 0)
{
//hey go right
}
There are two problems with your code. First, on line 1, you have:
if(distance(player.x, player.y, Al.x, Al.y) <= 0)This number is way to small. Try using 20
The second problem is on line 3:
//hey go rightThis is what's called a comment. A comment is anything that comes after two slash marks (//). These comments do not get executed. In other words, they don't do anything. They are only useful to add into your code to help other people understand. For example:
- Code: Select all
int a;//This is a comment that does nothing.
int b;//Only things that come after the two slashes are comments.
a = 5;//Now 'a' is equal to 5
b = a;//Do you see how comments work now?
So what you have to do is make some code that displays text to the player. You could do this by making an actor called "HeyGoRightText". Then going into the actor control and clicking text, adding a text file and then typing in your message. Then move it right above AI and set it's transperency to 1 (invisible). After that go into your AI code again and do this:
- Code: Select all
if(distance(player.x, player.y, Al.x, Al.y) <= 0)
{
HeyGoRightText.transp = 0;//This will make the message appear ;)
}
Hope that helps