more fixes ✨
runs now
This commit is contained in:
parent
7cc4875a10
commit
83b933f8a7
6 changed files with 22 additions and 8 deletions
|
|
@ -3,6 +3,7 @@ import "globals" for Globals
|
||||||
import "luxe: containers" for Lists
|
import "luxe: containers" for Lists
|
||||||
import "math/observable" for Observable
|
import "math/observable" for Observable
|
||||||
import "math/vector" for Vector
|
import "math/vector" for Vector
|
||||||
|
import "math/util" for Util
|
||||||
|
|
||||||
class Human{
|
class Human{
|
||||||
active{_active}
|
active{_active}
|
||||||
|
|
@ -36,11 +37,14 @@ class Human{
|
||||||
_name = "unnamed"
|
_name = "unnamed"
|
||||||
_adventure_count = 0
|
_adventure_count = 0
|
||||||
color = [1, 1, 1, 1]
|
color = [1, 1, 1, 1]
|
||||||
|
|
||||||
|
_material = Util.material_from_image_path("assets/wip/Human")
|
||||||
}
|
}
|
||||||
|
|
||||||
show(){
|
show(){
|
||||||
_entity = Entity.create(Globals["Game"].app.world, name)
|
_entity = Entity.create(Globals["Game"].app.world, name)
|
||||||
Transform.create(_entity)
|
Transform.create(_entity)
|
||||||
|
|
||||||
Sprite.create(_entity, _material, 10, 12)
|
Sprite.create(_entity, _material, 10, 12)
|
||||||
Sprite.set_color(_entity, _color.r, _color.g, _color.b, _color.a)
|
Sprite.set_color(_entity, _color.r, _color.g, _color.b, _color.a)
|
||||||
}
|
}
|
||||||
|
|
@ -50,8 +54,8 @@ class Human{
|
||||||
}
|
}
|
||||||
|
|
||||||
update(){
|
update(){
|
||||||
var index = __activeHumans.indexOf(this)
|
var index = __activeHumans.value.indexOf(this)
|
||||||
var pos = PlayerStart + PlayerSize / 2 + PlayerSize * index
|
var pos = PlayerStart + PlayerSize.y0() / 2 + PlayerSize.y0() * index
|
||||||
Transform.set_pos(_entity, pos.x, pos.y)
|
Transform.set_pos(_entity, pos.x, pos.y)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import "luxe: assets" for Assets
|
||||||
import "luxe: color" for Color
|
import "luxe: color" for Color
|
||||||
|
|
||||||
import "outline/app" for App
|
import "outline/app" for App
|
||||||
import "outline/Renderer" for Renderer
|
import "outline/renderer" for Renderer
|
||||||
import "blocks/ui/ui" for Ui
|
import "blocks/ui/ui" for Ui
|
||||||
import "blocks/debug" for DrawDebug, Holder
|
import "blocks/debug" for DrawDebug, Holder
|
||||||
import "globals" for Globals, RandomInst
|
import "globals" for Globals, RandomInst
|
||||||
|
|
|
||||||
|
|
@ -98,4 +98,4 @@ class M{
|
||||||
import "math/vector" for Vector
|
import "math/vector" for Vector
|
||||||
import "luxe: math" for Math
|
import "luxe: math" for Math
|
||||||
import "math/repVal" for RepVal
|
import "math/repVal" for RepVal
|
||||||
import "math/Util" for Util
|
import "math/util" for Util
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import "luxe: ui/control" for Control
|
||||||
import "luxe: world" for UIEvent, UI, Entity
|
import "luxe: world" for UIEvent, UI, Entity
|
||||||
|
|
||||||
import "math/math" for M
|
import "math/math" for M
|
||||||
import "math/Vector" for Vector
|
import "math/vector" for Vector
|
||||||
import "math/rect" for AABB
|
import "math/rect" for AABB
|
||||||
|
|
||||||
class Util{
|
class Util{
|
||||||
|
|
|
||||||
|
|
@ -44,12 +44,22 @@ class Vector is Sequence{
|
||||||
_y = -_y
|
_y = -_y
|
||||||
return this
|
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
|
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
|
return one.x > other.x || one.y > other.y
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import "luxe: world" for World, Camera, Entity, Transform
|
||||||
import "luxe: render" for Render
|
import "luxe: render" for Render
|
||||||
import "luxe: bytes" for Floats
|
import "luxe: bytes" for Floats
|
||||||
|
|
||||||
import "outline/Renderer" for Renderer
|
import "outline/renderer" for Renderer
|
||||||
import "globals" for Globals
|
import "globals" for Globals
|
||||||
import "math/rect" for AABB
|
import "math/rect" for AABB
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue