Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --love.load
- xy = {}
- table.insert(xy, {x = 200, y = 200})
- table.insert(xy, {x = 600, y = 200})
- table.insert(xy, {x = 600, y = 400})
- table.insert(xy, {x = 200, y = 400})
- linur = {}
- --love.update
- for i = 1, 4 do
- linur[i].nalaegd = pyth(mx, xy[i].x, my, xy[i].y)
- end
- function pyth(x1, x2, y1, y2)
- return math.sqrt((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2))
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement