compnents inherit from Component
This commit is contained in:
parent
e63e76f0a3
commit
5d979b3e5c
5 changed files with 11 additions and 5 deletions
|
|
@ -1,9 +1,10 @@
|
||||||
import { Point } from "../Datatypes/point"
|
import { Point } from "../Datatypes/point"
|
||||||
import { Texture } from "pixi.js"
|
import { Texture } from "pixi.js"
|
||||||
|
import { Component } from "ecsy"
|
||||||
|
|
||||||
|
|
||||||
// Door component
|
// Door component
|
||||||
export class Door {
|
export class Door extends Component {
|
||||||
open: boolean
|
open: boolean
|
||||||
|
|
||||||
openPosition: Point
|
openPosition: Point
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
import { Point } from "../Datatypes/point"
|
import { Point } from "../Datatypes/point"
|
||||||
|
import { Component } from "ecsy"
|
||||||
|
|
||||||
// Position component
|
// Position component
|
||||||
export class Position {
|
export class Position extends Component {
|
||||||
value: Point
|
value: Point
|
||||||
|
|
||||||
reset() {
|
reset() {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
|
import { Component } from "ecsy"
|
||||||
|
|
||||||
// Shape component
|
// Shape component
|
||||||
export class Shape {
|
export class Shape extends Component {
|
||||||
onStage = false
|
onStage = false
|
||||||
shape: PIXI.Graphics
|
shape: PIXI.Graphics
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import { Sprite } from "pixi.js";
|
import { Sprite } from "pixi.js";
|
||||||
|
import { Component } from "ecsy";
|
||||||
|
|
||||||
export class SpriteRenderer{
|
export class SpriteRenderer extends Component{
|
||||||
sprite: Sprite
|
sprite: Sprite
|
||||||
|
|
||||||
reset() :void {
|
reset() :void {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
import { Vector } from "../Datatypes/vector"
|
import { Vector } from "../Datatypes/vector"
|
||||||
|
import { Component } from "ecsy"
|
||||||
|
|
||||||
// Velocity component
|
// Velocity component
|
||||||
export class Velocity {
|
export class Velocity extends Component {
|
||||||
value: Vector
|
value: Vector
|
||||||
|
|
||||||
reset() {
|
reset() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue