rotation
i need my character to rotate with the axis where he is not in the center
init = function() hero = object x = -50 y = 50 height = 24 width = 24 rotation = 0 end gravity = 1 end
update = function() if hero.y >= -26 then hero.y -= gravity end if hero.y <= -26 then gravity = 0 end if keyboard.LEFT then hero.rotation -= 1 hero.x -= 1 end if keyboard.RIGHT then hero.rotation += 1 hero.x += 1 end gravity += 0.1 end
draw = function() screen.clear("rgb(70,0,0)") screen.setRotation(0) for i = -10 to 10 screen.drawSprite("floor",24i,-50,24,24) end for x = -10 to 10 for y = -74 to -100 screen.drawSprite("floor_two",x24,y*24,24,24) end end screen.setRotation(hero.rotation) screen.drawSprite("ball",hero.x,hero.y,hero.width,hero.height) end