This site requires JavaScript, please enable it in your browser!
Greenfoot back
-nic-
-nic- wrote ...

2012/4/6

I need help with ememy Ai

-nic- -nic-

2012/4/6

#
I need help to create a enemy that will track and follow the player Please help thx
SPower SPower

2012/4/6

#
You can put 2 instance variables in your world, called userX and userY. Update them from your player's object. This is what you basically need for that. Your enemy needs to acces them, so create to methods:
public int userX()
{
     return userX;
}

public int userY()
{
    return userY;
}
Then, you calcutate the route to the player.
-nic- -nic-

2012/4/6

#
sorry im a bit confused ive only been using greenfoot for 3 days thx
SPower SPower

2012/4/6

#
Are you also new to programming, or have you got some other programming experience?
-nic- -nic-

2012/4/6

#
i did a breif bit last christmas (greenfoot tutorial)!! and used scratch a bit!!
SPower SPower

2012/4/6

#
I give you the advice to first learn more about programming. The greenfoot book is a great way to that. It's not a schame, but it's better to first understand the terms we're talking about here. After you know Greenfoot and java, you can come back.
-nic- -nic-

2012/4/6

#
where can i get the greenfoot book??
SPower SPower

2012/4/6

#
http://www.amazon.com/Introduction-Programming-Greenfoot-Object-Oriented-Simulations/dp/0136037534 Good luck and I'm looking forward for your scenario's!
-nic- -nic-

2012/4/6

#
cant bye oh well just gotta work it out myself!
You need to login to post a reply.