diff --git a/Luxe/assets/names.lx b/Luxe/assets/names.lx index db5da8e..b0f2136 100644 --- a/Luxe/assets/names.lx +++ b/Luxe/assets/names.lx @@ -3,21 +3,24 @@ //make groups based on origin culture / meaning //probably better to do when I have a procgen text engine - "Bob" - "Steve" - "Ronja" "Amelia" + "Bob" + "Bug" "Chloe" - "Lauren" + "Claus" + "Ida" "Innes" - "Rami" - "Richard" "Jules" - "Mercedes" "Karl" "Lara" - "Bug" - "Sandra" - "Claus" + "Lauren" + "Levi" + "Mercedes" "Niels" + "Rami" + "Richard" + "Ronja" + "Sandra" + "Simon" + "Steve" ] \ No newline at end of file diff --git a/Luxe/blocks/ui/adventure.wren b/Luxe/blocks/ui/adventure.wren index 450dbf0..64d1015 100644 --- a/Luxe/blocks/ui/adventure.wren +++ b/Luxe/blocks/ui/adventure.wren @@ -112,15 +112,14 @@ class UiAdventure{ _game.adventures.planning.on_change(true){|val| if(val == null) return - var angle = val.direction * 360 / steps + var angle = -val.direction * 360 / steps UiCompass.set_angle(compass, angle) } Control.set_events(compass){|event| if(event.type == UIEvent.change){ var angle = event.change - - var angleIndex = M.repeat((steps * angle / 360).round, steps) + var angleIndex = M.repeat(-(steps * angle / 360).round, steps) var adventure = _game.adventures.planning adventure.value.direction = angleIndex adventure.emit() diff --git a/Luxe/blocks/ui/compass.wren b/Luxe/blocks/ui/compass.wren index edde663..d626fc3 100644 --- a/Luxe/blocks/ui/compass.wren +++ b/Luxe/blocks/ui/compass.wren @@ -9,6 +9,7 @@ import "globals" for Globals import "math/rect" for AABB import "math/math" for M import "blocks/debug" for DrawDebug +import "luxe: io" for IO class UiCompass{ static font{"assets/fonts/BabyBlocks"} @@ -27,9 +28,10 @@ class UiCompass{ var image = Assets.image("assets/wip/Needle") var ratio = Image.get_width(image) / Image.get_height(image) var needleSize = [(Math.min(w, h) - 8) * ratio, (Math.min(w, h) - 8)] + var angle = state["angle"] UI.draw_ring(control, center.x, center.y, depth, w/2, h/2, 0, 360, 8, state["style"]) UI.draw_image(control, center.x - needleSize.x/2, center.y-needleSize.y/2, depth, needleSize.x, needleSize.y, - state["angle"], [1,1,1,1], [0, 0, 1, 1], image, true) + angle, [1,1,1,1], [0, 0, 1, 1], image, true) } Control.set_process(compass){|control, state, event, x,y,w,h| if(event.control != control) return @@ -46,8 +48,8 @@ class UiCompass{ UI.uncapture(control) } else if(event.type == UIEvent.move && state["pressed"]){ var center = [x + w/2, y + h/2] - var diff = [center.x - event.x, center.y - event.y] - var angle = Math.atan2(diff.x, diff.y) + var diff = [event.x - center.x, event.y - center.y] + var angle = Math.atan2(-diff.y, diff.x) - Num.tau / 4 UI.events_emit(control, UIEvent.change, Math.degrees(angle)) } }