Search found 34 matches

by Ethan-Taylor
Wed Jul 01, 2015 10:30 pm
Forum: Support and Development
Topic: Hardon Collider Help
Replies: 17
Views: 7253

Re: Hardon Collider Help

In your custom border collision code, you are dividing the circle radius by 2 as if it were the diameter. There will be no shape intersection if you use 30 (half the width of your circle) instead of 30/2. Also you should have player:draw('line') instead of player:draw('line',50) on main.lua:103 Ahh...
by Ethan-Taylor
Wed Jul 01, 2015 5:35 am
Forum: Support and Development
Topic: Hardon Collider Help
Replies: 17
Views: 7253

Re: Hardon Collider Help

I probably should have expanded on the original thing, the reason why you get stuck is that when we set the velocity to zero, which means that the state that fired the collision event is still happening. You need to work out the position of the objects and move them back to where it was the frame b...
by Ethan-Taylor
Tue Jun 30, 2015 10:09 pm
Forum: Support and Development
Topic: Hardon Collider Help
Replies: 17
Views: 7253

Re: Hardon Collider Help

Ok, I have one more problem. Some of the collision is a bit off in the game. So the player has a bit of an offset when it collides with other things. The collision scripts for the square are on line 19 in main.lua and the ones for the player are line 95 in player.lua if you run the game you'll see w...
by Ethan-Taylor
Tue Jun 30, 2015 3:49 am
Forum: Support and Development
Topic: Hardon Collider Help
Replies: 17
Views: 7253

Re: Hardon Collider Help

function onCollide(dt, a, b) if a.ID = "player" then x,y = player:GetPos() player:SetPos(x+100,y+100) end end I have no idea how you have your player setup, so this is just the sort of thing you would do. This will move the player somewhere when you touch something, though instead you'll ...
by Ethan-Taylor
Tue Jun 30, 2015 2:48 am
Forum: Support and Development
Topic: Hardon Collider Help
Replies: 17
Views: 7253

Hardon Collider Help

Hey guys, I'm going to ask a really noobish question so bare with me. So I have a function set up like this : function onCollide(dt, a, b) end I need to correct the player position (movement.x and movement.y) when the player touches a collider called "square". player and square are both re...
by Ethan-Taylor
Thu Jun 25, 2015 9:23 am
Forum: Libraries and Tools
Topic: [library] bump.lua v3.1.4 - Collision Detection
Replies: 227
Views: 124405

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

You should try adding circular and triangular collision boxes.
by Ethan-Taylor
Tue Jun 16, 2015 10:10 pm
Forum: Support and Development
Topic: Camera Script Not Working.
Replies: 2
Views: 2012

Re: Camera Script Not Working.

I think i fixed it. I just changed lines 45 and 46 from this: rotcalc.x = love.mouse.getX() - movement.x rotcalc.y = love.mouse.getY() - movement.y To this: rotcalc.x = love.mouse.getX() + camera.x - movement.x rotcalc.y = love.mouse.getY() + camera.y - movement.y The file is in attachment Thanks, ...
by Ethan-Taylor
Tue Jun 16, 2015 3:16 am
Forum: Support and Development
Topic: Camera Script Not Working.
Replies: 2
Views: 2012

Camera Script Not Working.

Hey guys,
The following code doesn't quite work for the camera script located from 118 - 152 in main.lua.
I've used a cursor follow script that micha gave me a while ago, it doesn't quite work with the camera.
Any help?

Thanks, and sorry for spamming you with questions XD
by Ethan-Taylor
Mon Jun 15, 2015 10:30 pm
Forum: Support and Development
Topic: Circular Cursor Lock
Replies: 8
Views: 3413

Re: Circular Cursor Lock

micha what about less than? In that case, the function returns the actual mouse coordinates. That means that the mouse can freely move inside the circle, but if it is outside, the mouse position is corrected. I noticed an error I made in the previous code snippet. This is the corrected version. fun...
by Ethan-Taylor
Mon Jun 15, 2015 4:53 am
Forum: Support and Development
Topic: Circular Cursor Lock
Replies: 8
Views: 3413

Re: Circular Cursor Lock

You can try setting the mouse back into the circle every frame, but that can be laggy/glitchy/buggy. Alternatively enable relative mode and draw a virtual cursor yourself. The math is rather easy, get the vector between center of the screen and mousepos, then clamp that to the radius. https://love2...