## Search found 34 matches

Wed Jul 08, 2015 7:12 am
Forum: Support and Development
Topic: More Interesting Collisions? [SOLVED]
Replies: 6
Views: 656

### Re: More Interesting Collisions?

Yea, I didn't word it properly, I meant reversing the bullet's velocity. And yes, as davis mentioned, stationary objects have velocity of 0, where 0 doesn't affect the equation: relative_velocity = object1_velocity - object2_velocity How do we convert the original code into v.xvel and v.yvel? Sorry...
Wed Jul 08, 2015 1:24 am
Forum: Support and Development
Topic: More Interesting Collisions? [SOLVED]
Replies: 6
Views: 656

### Re: More Interesting Collisions?

Hello Ethan, It depends if you're going for 'realistic' physics, in which case you can't just reverse the velocity during a collision. For example, imagine a bullet hitting a wall. If the wall is perpendicular to the bullet's path, then you can reverse its velocity: How can the wall have velocity?!
Tue Jul 07, 2015 1:42 am
Forum: Support and Development
Topic: More Interesting Collisions? [SOLVED]
Replies: 6
Views: 656

### More Interesting Collisions? [SOLVED]

Hey guys, I'm using Hardon Collider for my project. At the moment I'm using it for everything including bullets that the player shoots. function ammo.update(dt) for i,v in ipairs(ammo) do if v.id == nil then v.id = ammo.id ammo.id = ammo.id + 1 end v.bullet.type = v.id v.xvel = v.xvel + 12000 * dt *...
Sun Jul 05, 2015 10:10 pm
Forum: Support and Development
Topic: Hardon Collider Glitch [SOLVED]
Replies: 2
Views: 279

### Re: Hardon Collider Glitch

This is not a Hardon Collider Glitch, this is a problem in your collission resolution code. Please attach a .love so we can look at your full code. I've got it now. All you had to do is find the opposite of dx and dy when the obsacle is shape_a. That's because Hardon Collider always finds those val...
Sun Jul 05, 2015 8:24 am
Forum: Libraries and Tools
Topic: [library] bump.lua v3.1.4 - Collision Detection
Replies: 227
Views: 62659

### Re: [library] bump.lua v3.1.4 - Collision Detection

I don't think you realize what you are asking. It has taken me years (literally) to get boxes working just right. The amount of math and time it would take to get circles and triangles working as they should is beyond me. Also, the library's interface would have to become more complex to allow for ...
Sat Jul 04, 2015 11:13 pm
Forum: Support and Development
Topic: Hardon Collider Glitch [SOLVED]
Replies: 2
Views: 279

### Hardon Collider Glitch [SOLVED]

Hey everyone, I'm having another Hardon Collider glitch. Most of the time the collision is flawless, but sometimes it does this: http://i.imgur.com/F85et5J.gif and that can get really annoying XD Here's the code: function onCollide(dt, shape_a, shape_b, dx, dy) if shape_a.type == "player" and shape_...
Thu Jul 02, 2015 5:33 am
Forum: Support and Development
Topic: Hardon Collider Help
Replies: 17
Views: 1486

### Re: Hardon Collider Help

FruityLark wrote:I can't see what you're missing without the code. Try the attached version.
just set the velocity to 0 now?
Thu Jul 02, 2015 3:01 am
Forum: Support and Development
Topic: Hardon Collider Help
Replies: 17
Views: 1486

### Re: Hardon Collider Help

Declare your onCollide function exactly the same as I showed, and you can just use them. HC provides these values (dx, dy) for you to resolve the collision. You also need to add the property 'type' or 'name' or whatever to your player shape, else the if statement in onCollide won't fire. player = c...
Thu Jul 02, 2015 2:04 am
Forum: Support and Development
Topic: Hardon Collider Help
Replies: 17
Views: 1486

### Re: Hardon Collider Help

Since the square is a collider shape, you need to fix the onCollide function. When you fix this, you will have an interesting situation where the ball jumps to the other side of the square as you continue to force the camera past the square. function onCollide(dt, shape_a, shape_b, dx, dy) if shape...
Thu Jul 02, 2015 12:17 am
Forum: Support and Development
Topic: Hardon Collider Help
Replies: 17
Views: 1486

### Re: Hardon Collider Help

Muzz wrote:I did, the wall collision worked fine?
Don't worry I've fixed it now.
But from this another problem has arised.
The collision with the sqaure is also offset.