I have a lot of questions so here they come:
-How would I add the attack animation, which is on a seperate sprite sheet (when using anim8)?
-How would I make the character move through the map without pressing a key? (I know this is simple, I just forgot since this is one of my earliest projects)
-How would I add an ai who stands in place and attacks when the player is close?
Game Devolpment Help
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Game Devolpment Help
2. Change character's position in (e.g. x+1, y+2)
3.Detect distance between your NPC and the character and start attack if less than D pixels (or squares ...)
Code: Select all
love.update
3.Detect distance between your NPC and the character and start attack if less than D pixels (or squares ...)

Re: Game Devolpment Help
If it's a basic linear path or other simple ruleset, then dusoft has the correct answer. If it's more complex like navigating a maze, you'll want to look into A* or a similar sort of pathfinding algorithm. There's lots of tutorials on the internet & even a bunch floating around here too.
Any code samples/ideas by me should be considered Public Domain (no attribution needed) license unless otherwise stated.
Re: Game Devolpment Help
This one has served me well (just note that it uses reversed Y,X notation):
https://github.com/Yonaba/Jumper

Who is online
Users browsing this forum: interested_party and 3 guests