xXweeguyXx wrote:Eamonn wrote:I'm not exactly sure how to do it, but in theroy:
You'd have a player's destinationX and destinationY value. Where ever the mouse clicks, make that the destinationX and destinationY value. If the player is not at that position yet, make the player move towards that position. I have tried to do this with your code, but for some reason it isn't working. There's the logic behind it: Make a desX and desY variable. Make it where ever the user clicks. Check if the player's X and Y position are not there yet and move them. Example:
Code: Select all
if player.x < desX then
player.x = player.x - player.speed * dt
end
if player.x > desX then
player.x = player.x + player.speed * dt
end
if player.y < desY then
player.y = player.y - player.speed * dt
end
if player.y > desY then
player.y = player.y + player.speed * dt
end
Welcome to the LÖVEly world of LÖVE. We hope you enjoy your stay
I see we have another sockmunkeedev tutorial video watcher... yeah, I can tell by your code. He does awesome tutorials.
EDIT: Guess VeeThree beat me to it! It's basically just pathfinding though. Check out Jumper if you want to use a library. If not, figure things out and
learn.
Again many thanks!
Yeah sorry about that... "see we have another sockmunkeedev tutorial video watcher" but hey you've got to start some where!
No, I meant it was good that you started with him. He has awesome tutorials. What I meant was: Don't copy his tutorials almost line for line. It's almost exactly like copy and pasting. Maybe try changing a few things up e.g. adding another menu or something? Just avoid copy and paste where possible. I'm sure a lot of people can agree. Sorry if I came across a bit bossy or mean or anything

I just like to see who people start LÖVE with. I started with Sock, but I know some people started with NeoSilky by their code and I also know some people that started with Goature because of their code. I've watched all the tutorials listed on the wiki and read through the wiki tutorials many times. I started with Sock, but I did change a lot of things from his tutorials.
Also, you might want to not double post. If you were like me and haven't been on many forums, you may not know what double posting is. Basically, it's when you post 2 threads in a row without letting another person post inbetween. Maybe merged your 2 posts together? You won't get banned for doing it, but you might just get told off or something.
As for the games idea, it sounds fun, but I don't know if it will be purely because we only know that the ball can move from where the mouse is clicked. That sounds very VERY awesome(I tried doing that, didn't work, and just didn't do it).