yet another collision question thread.

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
tehryanx
Prole
Posts: 17
Joined: Fri Apr 04, 2014 8:26 pm

Re: yet another collision question thread.

Post by tehryanx »

Thanks for having a look :) A few followup questions.

First, are you sure this is the case? The reason I'm asking is because when I collide with the ceiling just jumping straight up into it my yvel is set to 0 and I immediately fall.

Second, if you're right and this is what's causing the problem does this mean that setting the y velocity to 0 is not the proper action to take when colliding with something from below?

Thanks again for responding :)
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: yet another collision question thread.

Post by davisdude »

I'm fairly certain this is the case, but I can't be sure. I'll look around more when I get some time. :P
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
bizziboi
Citizen
Posts: 57
Joined: Sat Apr 16, 2011 9:24 am

Re: yet another collision question thread.

Post by bizziboi »

I haven't looked at the source, but if you are going up and hit your head you should set the y velocity to zero *if it's greater than zero, not if it's less'. Otherwise gravity won't be able to make you fall, as you keep negating it's effect by killing vertical velocity - you want to kill upward velocity only.
Post Reply

Who is online

Users browsing this forum: No registered users and 215 guests