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 » Wed Jun 26, 2013 5:56 pm

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 115 times

TheSquareRootOf3
Prole
Posts: 15
Joined: Wed Jun 26, 2013 5:41 pm

Re: Problems with vector player movement (im new)

Post by TheSquareRootOf3 » Wed Jun 26, 2013 6:11 pm

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 » Wed Jun 26, 2013 6:29 pm

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 » Wed Jun 26, 2013 6:32 pm

alright man, like this?
Attachments
Windwaker.love
(989.07 KiB) Downloaded 100 times

TheSquareRootOf3
Prole
Posts: 15
Joined: Wed Jun 26, 2013 5:41 pm

Re: Problems with vector player movement (im new)

Post by TheSquareRootOf3 » Wed Jun 26, 2013 6:38 pm

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 » Wed Jun 26, 2013 6:56 pm

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 » Wed Jun 26, 2013 7:07 pm

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 » Wed Jun 26, 2013 7:14 pm

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 100 times

User avatar
MadByte
Party member
Posts: 495
Joined: Fri May 03, 2013 6:42 pm
Location: Germany

Re: Problems with vector player movement (im new)

Post by MadByte » Wed Jun 26, 2013 7:20 pm

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 » Wed Jun 26, 2013 7:22 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests