+1tentus wrote:Hardon Collider
Whether it's a reference to Richard Dawkins' legendary typo or not.
Awesome. I'll have to try it.
I would want a set of MiddleClass shape objects that have collide functions. Just something as simple as that is what I imagined.Taehl wrote:Hell, I'd go code it myself if I knew exactly what the Love community wanted it to do.
It's good to discuss that now.Taehl wrote:So... How is the system going to work?
All possible. I would suggest going with whatever is both flexible and simple.Taehl wrote:Does one just have a table and everything in it collides with one-another? Or will there be multiple tables (one for statics (ground, platforms) and one for dynamics (player, enemies)?)?
Possibly.Taehl wrote:Are collisions going to be square? Rectangular?
Probably not. Too restrictive.Taehl wrote:Will it be tile-based?
Probably the former. It's a bit silly to have a physics lib that doesn't actually handle any physics.Taehl wrote:Is the collision and detection system going to control movement and momentum, or will it only inform objects that they've collided?
By all means, please do. Make a start, slap a name on it and release it unto the unsuspecting public. Even if it's not really what people want, we could still use parts of it if it's written in a reusable.Taehl wrote:Hell, I'd go code it myself if I knew exactly what the Love community wanted it to do.
Code: Select all
function love.load()
colsys = CollisionSystem:new() -- create a new collision system
colsys.step_size = 0.01 -- steps update every 1/100 of a second
colsys.step_max = 3 -- maximum amount of steps in one update
--create new bodies for the ground and player
player = Body:new("player", Shape:new("Circle", 50, 0, 16), colsys)
ground = Body:new("ground", Shape:new("Rect", 0, 0, 400, 50) colsys)
-- make a new callback for player and ground. The function will put the player's location above the ground.
colsys.callback["player"]["ground"] = function(player, ground) player.next.y = ground.current.y - player.next.height end
end
function love.update(dt)
-- advance the collision system.
colsys.advance(dt)
end
function love.draw()
-- drawX() and drawY() will tween the correct values so drawing is always smooth
love.graphics.draw(player_image, player.drawX(), player.drawY())
end
Users browsing this forum: Ahrefs [Bot] and 1 guest