diff --git a/Luxe/blocks/human.wren b/Luxe/blocks/human.wren index 34cb253..660a565 100644 --- a/Luxe/blocks/human.wren +++ b/Luxe/blocks/human.wren @@ -3,6 +3,7 @@ import "globals" for Globals import "luxe: containers" for Lists import "math/observable" for Observable import "math/vector" for Vector +import "math/util" for Util class Human{ active{_active} @@ -36,11 +37,14 @@ class Human{ _name = "unnamed" _adventure_count = 0 color = [1, 1, 1, 1] + + _material = Util.material_from_image_path("assets/wip/Human") } show(){ _entity = Entity.create(Globals["Game"].app.world, name) Transform.create(_entity) + Sprite.create(_entity, _material, 10, 12) Sprite.set_color(_entity, _color.r, _color.g, _color.b, _color.a) } @@ -50,8 +54,8 @@ class Human{ } update(){ - var index = __activeHumans.indexOf(this) - var pos = PlayerStart + PlayerSize / 2 + PlayerSize * index + var index = __activeHumans.value.indexOf(this) + var pos = PlayerStart + PlayerSize.y0() / 2 + PlayerSize.y0() * index Transform.set_pos(_entity, pos.x, pos.y) } diff --git a/Luxe/game.wren b/Luxe/game.wren index ec519f2..f291c37 100644 --- a/Luxe/game.wren +++ b/Luxe/game.wren @@ -8,7 +8,7 @@ import "luxe: assets" for Assets import "luxe: color" for Color import "outline/app" for App -import "outline/Renderer" for Renderer +import "outline/renderer" for Renderer import "blocks/ui/ui" for Ui import "blocks/debug" for DrawDebug, Holder import "globals" for Globals, RandomInst diff --git a/Luxe/math/math.wren b/Luxe/math/math.wren index 36af5cb..e800c01 100644 --- a/Luxe/math/math.wren +++ b/Luxe/math/math.wren @@ -98,4 +98,4 @@ class M{ import "math/vector" for Vector import "luxe: math" for Math import "math/repVal" for RepVal -import "math/Util" for Util +import "math/util" for Util diff --git a/Luxe/math/util.wren b/Luxe/math/util.wren index db0b521..51e3861 100644 --- a/Luxe/math/util.wren +++ b/Luxe/math/util.wren @@ -4,7 +4,7 @@ import "luxe: ui/control" for Control import "luxe: world" for UIEvent, UI, Entity import "math/math" for M -import "math/Vector" for Vector +import "math/vector" for Vector import "math/rect" for AABB class Util{ diff --git a/Luxe/math/vector.wren b/Luxe/math/vector.wren index fb2d9c3..8cdf2ff 100644 --- a/Luxe/math/vector.wren +++ b/Luxe/math/vector.wren @@ -44,12 +44,22 @@ class Vector is Sequence{ _y = -_y return this } + + x(new_x : Num) : Vector{ + _x = new_x + return this + } + + y(new_y : Num) : Vector{ + _y = new_y + return this + } - static or_lt(one, other){ + static or_lt(one, other) : Bool{ return one.x < other.x || one.y < other.y } - static or_gt(one, other){ + static or_gt(one, other) : Bool{ return one.x > other.x || one.y > other.y } diff --git a/Luxe/outline/app.wren b/Luxe/outline/app.wren index 35b71fa..cdd96f5 100644 --- a/Luxe/outline/app.wren +++ b/Luxe/outline/app.wren @@ -2,7 +2,7 @@ import "luxe: world" for World, Camera, Entity, Transform import "luxe: render" for Render import "luxe: bytes" for Floats -import "outline/Renderer" for Renderer +import "outline/renderer" for Renderer import "globals" for Globals import "math/rect" for AABB