Code: Select all
deg=math.pi/180
function love.draw()
love.graphics.draw(..., 20, 20, deg*val) --Val is the number of degrees
end
Code: Select all
function math.rtd(degree) --rtd=radians to degrees
return math.pi/180/degree
end
Code: Select all
deg=math.pi/180
function love.draw()
love.graphics.draw(..., 20, 20, deg*val) --Val is the number of degrees
end
Code: Select all
function math.rtd(degree) --rtd=radians to degrees
return math.pi/180/degree
end
Yes. math.rad() is the one LuaWeaver needs.Jasoco wrote:Wouldn't these work:
math.rad()
math.deg()
?
Code: Select all
-- Rotation code for turning right and left
if love.keyboard.isDown("right") then
hero.rot = math.deg(hero.rot)
hero.rot = hero.rot + rotSpeed
if hero.rot >= 360 then
hero.rot = 0
end
hero.rot = math.rad(hero.rot)
elseif love.keyboard.isDown("left") then
hero.rot = math.deg(hero.rot)
hero.rot = hero.rot - rotSpeed
if hero.rot <= -1 then
hero.rot = 359
end
hero.rot = math.rad(hero.rot)
end
Users browsing this forum: No registered users and 8 guests