Search found 5 matches

by wburton95
Wed Dec 19, 2018 1:32 am
Forum: Support and Development
Topic: How to offset a body on another body?
Replies: 1
Views: 2209

How to offset a body on another body?

I'm trying to figure out how to offset a body on another body so that it follows with with its rotation. I cannot find many clear resources on the subject. I'm working on a space shooter and I'm new to game development. I appreciate any help. main.lua function love.load() love.graphics.setDefaultFil...
by wburton95
Tue Dec 18, 2018 1:19 am
Forum: Support and Development
Topic: How do I get local coords?
Replies: 7
Views: 5220

Re: How do I get local coords? Rotating a sprite with physics. [Solved]

Here is my code. It works! Thank you again for all your help. function love.load() love.graphics.setDefaultFilter('nearest', 'nearest') world = love.physics.newWorld(0,0,true) redship = {} redship['body'] = love.physics.newBody(world, 0, 0, "dynamic") redship['shape'] = love.physics.newRec...
by wburton95
Mon Dec 17, 2018 11:07 pm
Forum: Support and Development
Topic: How do I get local coords?
Replies: 7
Views: 5220

Re: How do I get local coords?

Sorry for the double post. I've read your OP again now. Certainly I wouldn't use local coordinates to do that. An approach that may give decent results is to turn the ships at constant angular velocity. You need the difference between the original angle and the target angle, and the sign of that wi...
by wburton95
Mon Dec 17, 2018 8:12 pm
Forum: Support and Development
Topic: How do I get local coords?
Replies: 7
Views: 5220

Re: How do I get local coords?

Here is my script so far. function love.load() love.graphics.setDefaultFilter('nearest', 'nearest') world = love.physics.newWorld(0,0,true) redship = {} redship['body'] = love.physics.newBody(world, 0, 0, "dynamic") redship['shape'] = love.physics.newRectangleShape(5,5) redship['image'] = ...
by wburton95
Mon Dec 17, 2018 6:11 am
Forum: Support and Development
Topic: How do I get local coords?
Replies: 7
Views: 5220

How do I get local coords?

I'm new to love and I am building a little space shooter. I need to figure out how to get local coords to manipulate a physics body in the game. Basically I need to figure out how to rotate my ship on screen using the mouse, and then I want to dampen the rotation so it feels slow like a ship or tank...