Math is hard

This commit is contained in:
Lani Aung
2021-11-20 20:43:36 -07:00
parent 4060f3c69d
commit 720b387dd3
20 changed files with 1010 additions and 63 deletions
+1 -2
View File
@@ -3,7 +3,7 @@ export interface Playset {
readonly height: number
readonly width: number
readonly cels: Cel[]
readonly enabledSets: boolean[]
readonly sets: boolean[]
}
export interface Cel {
@@ -11,7 +11,6 @@ export interface Cel {
readonly fix: number
readonly initialPositions: Coordinate[]
readonly offset: Coordinate
readonly sets: boolean[]
currentPositions: Coordinate[]
currentFix: number
+2 -2
View File
@@ -52,7 +52,7 @@ export default class Tracker {
let element = elements[index] as HTMLDivElement
element.style.visibility = "hidden"
if (cel.sets[set]) {
if (cel.initialPositions[set] != null) {
element.style.visibility = "visible"
let position = Tracker.getCoordinate(cel, set)
element.style.left = `${position.x}px`
@@ -136,7 +136,7 @@ export default class Tracker {
this.setPlayArea(this.set)
})
this.playset.enabledSets.forEach((enabled, index) => {
this.playset.sets.forEach((enabled, index) => {
if (enabled) {
let button = new Builder("li")
.addChildren(new Builder("button")