Java Game Programming for Beginners - #17 - Smart, Path-Finding AI
Uploader Comments (TheJavaHub)
All Comments (19)
-
Im trying to make a game too, in my game its pretty much like this, but the player and the enemies can only move on the black (just made a picture in paint with black paths and spaces) can you tell me which methods to use or something? Or will there be a tutorial on that soon?
-
@raoskidoo15 If he hadn't answered yet: No, the enemys will not be stopped by collision. They still try to reach you (They would run into walls, if you stand behind the wall for example)! But you could make a boolean hunting; when true they try to reach the player and if they collide with something its false, they will stop hunting you. !for example! ;D
-
@TheJavaHub I'm pretty new to Programming , but I understand almost everything in your tutorial. I did the same code as you ( the minecraft game ) But I will change the graphics to a 2D game like Zelda. There will be houses and trees. I want to know if Colisions will stop my Player from passing through the Houses and the samething for Mobs
-
Think about the logic a little bit :)
While(Destination)
Do this
if (player and enemy == the same location)
Destination = false
does that help?
I recently stumbled upon your tutorials and i love them but there is one thing that would make me love them even more... if you would make the tutorial on AI that will find a path around objects and such. I've been thinking of ways to do this for a while now and I just can't seem to find a way to do it.
Enigma7995 4 weeks ago in playlist Beginner Java Game Programming
@Enigma7995 Maybe soon I will make an AI tutorial like that but if you want more information visit the forums and ask :)
TheJavaHub 3 weeks ago
Will Colisions Stop The ''Enemy'' to Follow me ? I'm creating an 2D RPG a bit like Zelda.
raoskidoo15 3 months ago
@raoskidoo15 How do you mean? Collisions with your player?
TheJavaHub 3 months ago
Sorry I feel like I'm spamming this video with comments but is this the latest one because I can't find num 18 if there is one?
JackoLlamaGaming 4 months ago
@JackoLlamaGaming This is the latest one so far. Subscribe to make sure you see the latest ones :)
TheJavaHub 4 months ago