Problems with vector player movement (im new)

General discussion about LÖVE, Lua, game development, puns, and unicorns.
TheSquareRootOf3
Prole
Posts: 15
Joined: Wed Jun 26, 2013 5:41 pm

Problems with vector player movement (im new)

Post by TheSquareRootOf3 »

hey guys,
im trying to make my player move a little smoother across the screen, but you see the problem here is that he moves up incredibly slowly, and for some reason when holding the right and up arrow keys, the character moves down and right. all of the other controls work perfectly fine, can someone please help me out?
Attachments
player.lua
(1.09 KiB) Downloaded 310 times
TheSquareRootOf3
Prole
Posts: 15
Joined: Wed Jun 26, 2013 5:41 pm

Re: Problems with vector player movement (im new)

Post by TheSquareRootOf3 »

also, if you guys need another one of my files just let me know, i just figure the problem is here
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Problems with vector player movement (im new)

Post by Robin »

It will probably help if you upload your whole .love, so we can playtest to see the problem with our own eyes and test a possible solution out before suggesting it to you.
Help us help you: attach a .love.
TheSquareRootOf3
Prole
Posts: 15
Joined: Wed Jun 26, 2013 5:41 pm

Re: Problems with vector player movement (im new)

Post by TheSquareRootOf3 »

alright man, like this?
Attachments
Windwaker.love
(989.07 KiB) Downloaded 291 times
TheSquareRootOf3
Prole
Posts: 15
Joined: Wed Jun 26, 2013 5:41 pm

Re: Problems with vector player movement (im new)

Post by TheSquareRootOf3 »

theres also problems with the camera movement
TheSquareRootOf3
Prole
Posts: 15
Joined: Wed Jun 26, 2013 5:41 pm

Re: Problems with vector player movement (im new)

Post by TheSquareRootOf3 »

any ideas anyone? common, its soooo annoying.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Problems with vector player movement (im new)

Post by Robin »

It's a RAR-file. :( Please only use ZIP-files as .loves. I can't help you any better than before.
Help us help you: attach a .love.
TheSquareRootOf3
Prole
Posts: 15
Joined: Wed Jun 26, 2013 5:41 pm

Re: Problems with vector player movement (im new)

Post by TheSquareRootOf3 »

alright there! is it a zip file now ? sorry, when i say im new to this i litterally mean ive been at it for like 4 hours
Attachments
Windwaker.love
(992.49 KiB) Downloaded 293 times
User avatar
MadByte
Party member
Posts: 533
Joined: Fri May 03, 2013 6:42 pm
Location: Braunschweig, Germany

Re: Problems with vector player movement (im new)

Post by MadByte »

TheSquareRootOf3 wrote:alright there! is it a zip file now ? sorry, when i say im new to this i litterally mean ive been at it for like 4 hours
Then, welcome here ;)

I guess this is the problem:

Code: Select all

player.yvel = player.xvel - player.speed * dt
you used xvel instead of yvel.
TheSquareRootOf3
Prole
Posts: 15
Joined: Wed Jun 26, 2013 5:41 pm

Re: Problems with vector player movement (im new)

Post by TheSquareRootOf3 »

thanks for the welcoming! but im sorry, what exactly should i replace with that?
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Hugues Ross and 42 guests