Page 1 of 2

Problems with vector player movement (im new)

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

Re: Problems with vector player movement (im new)

Posted: Wed Jun 26, 2013 6:11 pm
by TheSquareRootOf3
also, if you guys need another one of my files just let me know, i just figure the problem is here

Re: Problems with vector player movement (im new)

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

Re: Problems with vector player movement (im new)

Posted: Wed Jun 26, 2013 6:32 pm
by TheSquareRootOf3
alright man, like this?

Re: Problems with vector player movement (im new)

Posted: Wed Jun 26, 2013 6:38 pm
by TheSquareRootOf3
theres also problems with the camera movement

Re: Problems with vector player movement (im new)

Posted: Wed Jun 26, 2013 6:56 pm
by TheSquareRootOf3
any ideas anyone? common, its soooo annoying.

Re: Problems with vector player movement (im new)

Posted: Wed Jun 26, 2013 7:07 pm
by Robin
It's a RAR-file. :( Please only use ZIP-files as .loves. I can't help you any better than before.

Re: Problems with vector player movement (im new)

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

Re: Problems with vector player movement (im new)

Posted: Wed Jun 26, 2013 7:20 pm
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.

Re: Problems with vector player movement (im new)

Posted: Wed Jun 26, 2013 7:22 pm
by TheSquareRootOf3
thanks for the welcoming! but im sorry, what exactly should i replace with that?