Hi,
Noob in programming here(:3), also first post, so bare with. I've attached my .love file (that's what I'm supposed to do right?) because I'm having problems with moving a player entity. I think I've managed to create an entity (with the help of a friend) in the form of a turtle (sorry, my graphics skills are rather bad) that I would like to be able to make move around the screen, and stop at the edges of my arena. Also, I've also attempted to update to love 0.9.0, and it says in the compiled file that the game was made for another version. How can I fix this?
Thanks for putting up will my noobiness and for all replies .
How do I make entities move?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
How do I make entities move?
- Attachments
-
- TurtleWars.love
- (3.55 MiB) Downloaded 146 times
- Roland_Yonaba
- Inner party member
- Posts: 1563
- Joined: Tue Jun 21, 2011 6:08 pm
- Location: Ouagadougou (Burkina Faso)
- Contact:
Re: How do I make entities move?
It just works fine here.23456bn wrote: Also, I've also attempted to update to love 0.9.0, and it says in the compiled file that the game was made for another version. How can I fix this?
How exactly do you want it to move ? Randomly ?23456bn wrote:...I would like to be able to make move around the screen, and stop at the edges of my arena. Also, I've also attempted to update to love 0.9.0, and it says in the compiled file that the game was made for another version. How can I fix this?
Thanks for putting up will my noobiness and for all replies .
Or does it supposed to follow a specific path ? Actually, when I say "path", I mean you have an ordered set of locations the entity should visit one after another.
Re: How do I make entities move?
I was hoping to be able to control my turtle by pressing the "WASD" keys to make it move left, right, front and back, rather than in a set path or randomly.
Thanks.
Thanks.
- Roland_Yonaba
- Inner party member
- Posts: 1563
- Joined: Tue Jun 21, 2011 6:08 pm
- Location: Ouagadougou (Burkina Faso)
- Contact:
Re: How do I make entities move?
There are many ways to achieve that. A simple one is to use love.keyboard.isDown and increase/decrease the x/y pair coordinates controlling the entity position accordingly. See the hamster ball tutorial for reference.23456bn wrote:I was hoping to be able to control my turtle by pressing the "WASD" keys to make it move left, right, front and back, rather than in a set path or randomly.
Thanks.
Re: How do I make entities move?
Thanks, I'll try it out!
Re: How do I make entities move?
I might be being an idiot here, if so sorry, but when I press the W,A,S,D keys it gives me an error...(and yes, I have replaced the "left", "right" etc. with WASD).
Am I not selecting the entity for adjusting its x and y? If so, how do I do this?
Thanks again.
Am I not selecting the entity for adjusting its x and y? If so, how do I do this?
Thanks again.
- Attachments
-
- TurtleWars.love
- (1.94 MiB) Downloaded 330 times
Re: How do I make entities move?
Welcome to the forums, my dear William!
For the solution to all your problems look in gamestate.lua under updateTurtles(dt)
For the solution to all your problems look in gamestate.lua under updateTurtles(dt)
- Attachments
-
- TurtleWars.love
- (18.32 KiB) Downloaded 136 times
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
Re: How do I make entities move?
Salutations to you too David!
Thanks mate. Also thanks Roland_Yonaba!
Works now.
Thanks mate. Also thanks Roland_Yonaba!
Works now.
- Roland_Yonaba
- Inner party member
- Posts: 1563
- Joined: Tue Jun 21, 2011 6:08 pm
- Location: Ouagadougou (Burkina Faso)
- Contact:
Re: How do I make entities move?
Side note, instead of posting the whole file for such problem, you could have posted the relevant code.
Glad it worked out, though.
Glad it worked out, though.
Re: How do I make entities move?
That's a bit of a catch-22 isn't it? When someone post code snippets we request the whole thing, when they post the whole thing we request snippets. Maybe posting both would be more useful though.Roland_Yonaba wrote:Side note, instead of posting the whole file for such problem, you could have posted the relevant code.
Glad it worked out, though.
Your screen is very zoomed in...
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 3 guests