From 79cf912e9ae6911f2b4b3eaf9d2cafe8c307d5a7 Mon Sep 17 00:00:00 2001 From: Ronja Date: Thu, 6 Feb 2020 11:57:43 +0100 Subject: [PATCH] progress: lots of important architecture --- Assets/Background.aseprite | Bin 4788 -> 2741 bytes Assets/Door.aseprite | Bin 0 -> 812 bytes Assets/Door.json | 33 ++++ Assets/Human.aseprite | Bin 0 -> 984 bytes Assets/Mockup.aseprite | Bin 0 -> 5529 bytes Program/assets/Background.png | Bin 0 -> 1804 bytes Program/assets/Door.json | 33 ++++ Program/assets/Door.png | Bin 0 -> 409 bytes Program/assets/Human.png | Bin 0 -> 285 bytes {src => Program}/assets/bunny.png | Bin {src => Program}/index.html | 6 +- Program/package.json | 18 +++ Program/src/Components/door.ts | 24 +++ Program/src/Components/position.ts | 10 ++ Program/src/Components/shape.ts | 10 ++ Program/src/Components/spriteRenderer.ts | 9 ++ Program/src/Components/velocity.ts | 10 ++ Program/src/Datatypes/point.ts | 39 +++++ Program/src/Datatypes/vector.ts | 53 +++++++ Program/src/Systems/DoorSystem.ts | 48 ++++++ Program/src/Systems/MovableSystem.ts | 31 ++++ Program/src/Systems/RenderSystem.ts | 12 ++ Program/src/Systems/ShapeRenderSystem.ts | 36 +++++ Program/src/Systems/SpriteSystem.ts | 43 ++++++ Program/src/Systems/TestSystem.ts | 21 +++ Program/src/constants.ts | 4 + Program/src/index.ts | 65 ++++++++ Program/src/random.ts | 45 ++++++ Program/src/resources.ts | 13 ++ Program/src/util.ts | 19 +++ Program/style.css | 11 ++ Program/tsconfig.json | 7 + Program/webpack.config.js | 26 ++++ src/assets/Background.png | Bin 6234 -> 0 bytes src/game.ts | 182 ----------------------- src/package.json | 9 -- src/tsconfig.json | 62 -------- 37 files changed, 622 insertions(+), 257 deletions(-) create mode 100644 Assets/Door.aseprite create mode 100644 Assets/Door.json create mode 100644 Assets/Human.aseprite create mode 100644 Assets/Mockup.aseprite create mode 100644 Program/assets/Background.png create mode 100644 Program/assets/Door.json create mode 100644 Program/assets/Door.png create mode 100644 Program/assets/Human.png rename {src => Program}/assets/bunny.png (100%) rename {src => Program}/index.html (79%) create mode 100644 Program/package.json create mode 100644 Program/src/Components/door.ts create mode 100644 Program/src/Components/position.ts create mode 100644 Program/src/Components/shape.ts create mode 100644 Program/src/Components/spriteRenderer.ts create mode 100644 Program/src/Components/velocity.ts create mode 100644 Program/src/Datatypes/point.ts create mode 100644 Program/src/Datatypes/vector.ts create mode 100644 Program/src/Systems/DoorSystem.ts create mode 100644 Program/src/Systems/MovableSystem.ts create mode 100644 Program/src/Systems/RenderSystem.ts create mode 100644 Program/src/Systems/ShapeRenderSystem.ts create mode 100644 Program/src/Systems/SpriteSystem.ts create mode 100644 Program/src/Systems/TestSystem.ts create mode 100644 Program/src/constants.ts create mode 100644 Program/src/index.ts create mode 100644 Program/src/random.ts create mode 100644 Program/src/resources.ts create mode 100644 Program/src/util.ts create mode 100644 Program/style.css create mode 100644 Program/tsconfig.json create mode 100644 Program/webpack.config.js delete mode 100644 src/assets/Background.png delete mode 100644 src/game.ts delete mode 100644 src/package.json delete mode 100644 src/tsconfig.json diff --git a/Assets/Background.aseprite b/Assets/Background.aseprite index 33312e209a65b3d392aa1456edf2fc6d3f89fb42..433a27de4796c67908731d2f89032f45b895c8d9 100644 GIT binary patch delta 2161 zcmV-%2#)u(CAAd-wF;2}ehoDW008>&2>@gO000TGje`LJB9jpU6_Y{&DgkekX#*aA zQN%C|g^QpAxN)EWsDTPNQ4D=-r!X8cli5jZ{k$j1SsgU|B$lnuPm(v8y?wp?-UjyZ z{4~5iv+ws8m5qE@eS6mLjeqY0xh^g9v+Inx?hVP%t1l*ZrZE{J_8qMm#(q{~=;6Yi zJA>g>a&@+!D2CepS;Y`+tLJj0wjP;(AxdXf{h}FG%R^Q@X4Jz>{YC4Q5x>@lcKx%M z5ga_)ub@Ll&a(RR(HQ30hIyW-WEFBbN<-RpRc07%QZC!|`}=2m$YyBKj^|!!|2gt& z)wqOVb)8kWe}2u-&v5^<&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oPDtexn&w?K=Rz^_~FlH|zkL_ihDCbxKflx9y5Ea-Ba z2c1pzprc#^>hpLICA9)__V=~u2CbkEG=UDF4|j+stS#_`EKH#ZM+m|WYVd*-jGzM- zCL&2tKt95ej96qM5J74dCg9xv6tj?%#cprAffXktHzXWQvQlw5I(&UM4IAAD74n$8 z{Ni)v*RCs>tCLc3L5X5?XjAqJ>lb4$KW1Ny@sIDc_uY-1%^kel-C7&@HNGuNohzFC zu8}vAFFd93TiuQCpA=e;jz-_rv|Q4h5!>p&4YwQ_56zjvSBu>~+hlORb1Go-B0Rn% zOI!_hA$l;F8@ncd-FQla+pYm+lYT(Cd_1jvCWD*j7Ir#r6{rqP_bgNxbNb`bh3L~y z{nIalA5D)o)JD4%2D9z8UvtmZB@RBwJGI&941V@F%K{D|LtLI%-(U(K>+JZ!S9SJI Pc(YeL)hkr#I{p1O7l`le literal 0 HcmV?d00001 diff --git a/Assets/Door.json b/Assets/Door.json new file mode 100644 index 0000000..c3f52ac --- /dev/null +++ b/Assets/Door.json @@ -0,0 +1,33 @@ +{ "frames": [ + { + "filename": "Door 0.aseprite", + "frame": { "x": 0, "y": 0, "w": 21, "h": 23 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 21, "h": 23 }, + "sourceSize": { "w": 21, "h": 23 }, + "duration": 100 + }, + { + "filename": "Door 1.aseprite", + "frame": { "x": 21, "y": 0, "w": 21, "h": 23 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 21, "h": 23 }, + "sourceSize": { "w": 21, "h": 23 }, + "duration": 100 + } + ], + "meta": { + "app": "http://www.aseprite.org/", + "version": "1.2.16.3-x64", + "image": "Door.png", + "format": "RGBA8888", + "size": { "w": 42, "h": 23 }, + "scale": "1", + "frameTags": [ + ], + "slices": [ + ] + } +} diff --git a/Assets/Human.aseprite b/Assets/Human.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..617a3c44e5611568f4a50abcf989f716f1cc995c GIT binary patch literal 984 zcmcJL|1Z>W9LL|jMPFtYs`)a`UA{yKJ37S0Buj3R(xy#^k>zge+|3Z1C0|Pt)^MdV z^8?NI_<=g-ONl0{e7$@P`If{FZhU$kYV`;7dVk)J_h;|-dwV`!?*TPJ#>!NPCfQHu zM1>F%hPhL8ET%+7xk+dk|D&!Ve`7^sJ5>V#hcPwj+mV08jp1LPZo0ce-(7bWfA6yt zA?IA|K=W%Jp#Et$P?qZlJ_)h`dCpAGg`o?si{e3wc!Cm32QX8|2s}Q!29o?aP=}iV znp-RHY|ZeLtYU$+0s3I669ddDssk?sC{NiOU(keM3sNXTzAdhTA4g`uSKT9Ed~^gT zx*iBdyPJTv#xxK`@d0(^>zkq*w1Pg+1Ui5|+#$Yg?FnDV!W5ctgdpso1}{j#2s&_4 zicl03kdJUABNmwmM3AvEjE;BzQ%Z|H#9PGY351=n(4Z4CicL!O_Z2JRMB<7U2RS|| z7xg+{l3b1x1*(H}9QD~x2i_%K~L*+yT=?k>oB z2Uvb@igLO&5^63Fb#dhuDY=u6>Z_2rl#uzLq zYy^tM+kCU?g;a%Cjg?@2>cGR^o|#37E3chf#urRaREwlt<8H2>X^l;=Uoxj-FaQ7m literal 0 HcmV?d00001 diff --git a/Assets/Mockup.aseprite b/Assets/Mockup.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..b1222d2066956c057215a5abbfcf63d9486a57eb GIT binary patch literal 5529 zcmcJTc|26#|HnsJN@EF`k+El~EHh1n!4y75MU=9H%#6M4`_fRBLDocNuPDhLDI{CS z9?HJNV6w+Bmce{4pYQkg>HGM8K7ans%zfTF_ndoPulM_$bMJjj(lHR|$4ds#Rp28G zVgP|aR>1aW5e9Z5Acnn@AWq=(|55k={jFvGeN}!yfEU$Ui zC?L@60tMjrVKTs))?t8tF17$Yu|@!0E(igH3vvPk3f&O^<6ibffM|eFfH;64fCvEl zfOo+7zH3duFJKmM3fKfZ0tNwhfHlAuUXa2np0j|>6XR7(o*56l+B_oYSb8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E!vf$i5V$;D-l@jcCuv=t0BYT^uV;j~6>ZX5jRAG0{Yi^B8FlYi7?JCvuEp7+E01e0a~;Xul%R z!*jd;!Mi}clZf}|S}T`yL!2V%s1er2m?I47oz>AkJ?!C8CGX%Zx zuR0fXF0X5Xmo&2&^N0;o|)W;$Cu5NGDvWw7EIOzcmSdlM z?g^}W$q`gx(hF4)M4UrLAFqvV-o=>M@S=>%kIEwH5~1{$4F?UN^R6x--HaZ}PO&zc$W@yyjlXG&`)B zt7sH;GSNlcYZ(z_gpm>HtI=brzcTF=@JANOM|s>R%^D3UD_1`85D?|Z8}@YL#HdXi zm7o~0fYC8SsW6VYDtI5GQfNUaDLdC>qLso7K3hMSG@qR_;qjSmJEfz0q?L#}aa#+KoTHBgE4ZRn~17v$2eB092zqnwKfeW){a&F3n`lVrS>z#{!7z>$f+f`S@Q$J+TzK7`+uS;#LJhlgM{$ zt?}!A;hOB&d-rSYdpRl3BrR`1E;OxgEarW+AOE!YK6?J_>4Rk0x{97RVn*JfDEnt> zdv9DWOw~JkwGVwCVy(XiC{1J$YUB2_vS9ZI98ks(1}$wYeGu)HeJy4PeGMvadv>y< uBkk|8pzmJoF^6t*kG-7}EqSarTlxq1UGy%E%(sRB00003dcH literal 0 HcmV?d00001 diff --git a/Program/assets/Door.json b/Program/assets/Door.json new file mode 100644 index 0000000..eeb70da --- /dev/null +++ b/Program/assets/Door.json @@ -0,0 +1,33 @@ +{ "frames": [ + { + "filename": "Door 0", + "frame": { "x": 0, "y": 0, "w": 21, "h": 23 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 21, "h": 23 }, + "sourceSize": { "w": 21, "h": 23 }, + "duration": 100 + }, + { + "filename": "Door 1", + "frame": { "x": 21, "y": 0, "w": 21, "h": 23 }, + "rotated": false, + "trimmed": false, + "spriteSourceSize": { "x": 0, "y": 0, "w": 21, "h": 23 }, + "sourceSize": { "w": 21, "h": 23 }, + "duration": 100 + } + ], + "meta": { + "app": "http://www.aseprite.org/", + "version": "1.2.16.3-x64", + "image": "Door.png", + "format": "RGBA8888", + "size": { "w": 42, "h": 23 }, + "scale": "1", + "frameTags": [ + ], + "slices": [ + ] + } +} diff --git a/Program/assets/Door.png b/Program/assets/Door.png new file mode 100644 index 0000000000000000000000000000000000000000..e4d8725a43ea7dbacdbce3af12954b4ebddda8cb GIT binary patch literal 409 zcmV;K0cQS*P)Px$Q%OWYR7i=I#KoIlyanHS%NMNb0nR=D|z==J+Re$@+Eo-YHBh)jtX~TEaHRZ=^uD83KfwnaR z%TsVM1q1UOtlwSWu5k_8)(lmVVSGGg*Oar#p=H9k&T+xdBB~%`$mi6%=TYDo%ek1O z9Z4I~j;=XQU6#j+stvIOW{U!I%VR^X6_RgG;+qglT~q2uop-(6SBuKmM-P!N)$Ckm zc}l2RL`UVQ%i5)s;9>$*)u;fEDkLQZxb{t3e*~ZjVQR^GrI#FyZT;50HE3+We&D1Z z_~!Mbt(gQ~bEGOV^8GXJCk&(naJPf;@%%R^mvqB7lbnkQdu)m!4XRoc%hO=D`jATO z4`+-fU|E0GXaWG~zAoTmQvXQ1T1ZSK#%1}m(FA~BYkjm{vRT+=00000NkvXXu0mjf DC+oT< literal 0 HcmV?d00001 diff --git a/Program/assets/Human.png b/Program/assets/Human.png new file mode 100644 index 0000000000000000000000000000000000000000..62951559c577bd38dad22ebab183ec53bde787f4 GIT binary patch literal 285 zcmV+&0pk9NP)Px#*GWV{R2Y?2jJr+(Q4~ejxsHiEhKC_AgNcPC6j0cJBqY#M`VW2$UqR;w_!BnL zXh~wpFb-sbJY<02wYtN&o4t3|*+&KqhfQ?Ub*I3@Ut&Cabtx(dfcRh&9kpe^ynD~6 zo#W|k1+VYaodU`%M(x}`pZH5;*mr1_MTgTAFZmje-=AFH>==7mlmP(S^#Xu!nxa(| ztw<~-Q|mH@?G2YG&IvR|e3BACUXRCY< - Hello! + <%= htmlWebpackPlugin.options.title %> @@ -10,7 +10,7 @@ margin: 0; padding: 0; } - + canvas { image-rendering: -moz-crisp-edges; image-rendering: -webkit-crisp-edges; @@ -18,9 +18,7 @@ image-rendering: crisp-edges; } - - \ No newline at end of file diff --git a/Program/package.json b/Program/package.json new file mode 100644 index 0000000..fa0111b --- /dev/null +++ b/Program/package.json @@ -0,0 +1,18 @@ +{ + "scripts": { + "start": "webpack-dev-server -w", + "build": "rm -rf dist && webpack --config ./webpack.config.js --mode production --progress --colors" + }, + "dependencies": { + "ecsy": "^0.2.2", + "pixi.js": "^5.2.1" + }, + "devDependencies": { + "html-webpack-plugin": "^3.2.0", + "ts-loader": "^6.2.1", + "typescript": "^3.7.5", + "webpack": "^4.41.5", + "webpack-cli": "^3.3.10", + "webpack-dev-server": "^3.10.2" + } +} diff --git a/Program/src/Components/door.ts b/Program/src/Components/door.ts new file mode 100644 index 0000000..af776d3 --- /dev/null +++ b/Program/src/Components/door.ts @@ -0,0 +1,24 @@ +import { Point } from "../Datatypes/point" +import { Texture } from "pixi.js" + + +// Door component +export class Door { + open: boolean + + openPosition: Point + closedPosition: Point + + openTex: Texture + closedTex: Texture + + reset() { + this.open = false + + this.openPosition = null + this.closedPosition = null + + this.openTex = null + this.closedTex = null + } +} \ No newline at end of file diff --git a/Program/src/Components/position.ts b/Program/src/Components/position.ts new file mode 100644 index 0000000..a22124c --- /dev/null +++ b/Program/src/Components/position.ts @@ -0,0 +1,10 @@ +import { Point } from "../Datatypes/point" + +// Position component +export class Position { + value: Point + + reset() { + this.value = new Point(0, 0) + } +} \ No newline at end of file diff --git a/Program/src/Components/shape.ts b/Program/src/Components/shape.ts new file mode 100644 index 0000000..0dfab3d --- /dev/null +++ b/Program/src/Components/shape.ts @@ -0,0 +1,10 @@ +// Shape component +export class Shape { + onStage = false + shape: PIXI.Graphics + + reset() { + this.onStage = false + this.shape = null + } +} \ No newline at end of file diff --git a/Program/src/Components/spriteRenderer.ts b/Program/src/Components/spriteRenderer.ts new file mode 100644 index 0000000..8b2f94d --- /dev/null +++ b/Program/src/Components/spriteRenderer.ts @@ -0,0 +1,9 @@ +import { Sprite } from "pixi.js"; + +export class SpriteRenderer{ + sprite: Sprite + + reset() :void { + this.sprite = null + } +} \ No newline at end of file diff --git a/Program/src/Components/velocity.ts b/Program/src/Components/velocity.ts new file mode 100644 index 0000000..5681b93 --- /dev/null +++ b/Program/src/Components/velocity.ts @@ -0,0 +1,10 @@ +import { Vector } from "../Datatypes/vector" + +// Velocity component +export class Velocity { + value: Vector + + reset() { + this.value = new Vector(0, 0) + } +} \ No newline at end of file diff --git a/Program/src/Datatypes/point.ts b/Program/src/Datatypes/point.ts new file mode 100644 index 0000000..c90833b --- /dev/null +++ b/Program/src/Datatypes/point.ts @@ -0,0 +1,39 @@ +import { IPoint } from "pixi.js" +import { Vector } from "./vector" + +// my own point I can extend however I want to, compatible with pixijs points +export class Point implements IPoint{ + x: number + y: number + + constructor(x: number, y: number){ + this.x = x + this.y = y + } + + to(other: Point): Vector{ + return new Vector(this.x - other.x, this.y - other.y) + } + + add(vec: Vector): Point{ + return this.set(vec.x, vec.y) + } + + set(x?: number, y?: number): this { + if (x !== undefined) + this.x = x + if (y !== undefined) + this.y = y + return this + } + copyFrom(p: IPoint): this { + return this.set(p.x, p.y) + } + copyTo(p: IPoint): IPoint { + p.set(this.x, this.y) + return p + } + equals(p: IPoint): boolean { + return this.x === p.x && this.y === p.y + } +} \ No newline at end of file diff --git a/Program/src/Datatypes/vector.ts b/Program/src/Datatypes/vector.ts new file mode 100644 index 0000000..093d1bc --- /dev/null +++ b/Program/src/Datatypes/vector.ts @@ -0,0 +1,53 @@ +import { IPoint } from "pixi.js" + +// my own point I can extend however I want to, compatible with pixijs points +export class Vector implements IPoint{ + x: number + y: number + + constructor(x: number, y: number){ + this.x = x + this.y = y + } + + normalize(): this { + let len = this.length() + if(len < 0.001){ + this.set(0, 0) + } else { + this.scale(1/len) + } + return this + } + + length(): number { + return Math.sqrt(this.x*this.x + this.y*this.y) + } + + scale(scalar: number): this { + this.set(this.x*scalar, this.y*scalar) + return this + } + + scaled(scalar: number): Vector { + return new Vector(this.x * scalar, this.y * scalar) + } + + set(x?: number, y?: number): void { + if (x !== undefined) + this.x = x + if (y !== undefined) + this.y = y + } + copyFrom(p: IPoint): this { + this.set(p.x, p.y) + return this + } + copyTo(p: IPoint): IPoint { + p.set(this.x, this.y) + return p + } + equals(p: IPoint): boolean { + return this.x === p.x && this.y === p.y + } +} \ No newline at end of file diff --git a/Program/src/Systems/DoorSystem.ts b/Program/src/Systems/DoorSystem.ts new file mode 100644 index 0000000..d148839 --- /dev/null +++ b/Program/src/Systems/DoorSystem.ts @@ -0,0 +1,48 @@ +import { System, Entity } from "ecsy" +import { Position } from "../Components/position"; +import { Door } from "../Components/door"; +import { SpriteRenderer } from "../Components/spriteRenderer"; +import { IPoint, Texture, Sprite } from "pixi.js"; +import { addOrSetComponent } from "../util"; + +// MovableSystem +export class DoorSystem extends System { + // This method will get called on every frame by default + execute(delta : number) { + // Iterate through all the entities on the query + this.queries.newDoors.added.forEach((entity: Entity) => { + let door = entity.getComponent(Door) + + let doorPos: IPoint = door.open ? door.openPosition : door.closedPosition + addOrSetComponent(entity, Position, {value: doorPos}) + + let doorTex: Texture = door.open ? door.openTex : door.closedTex + addOrSetComponent(entity, SpriteRenderer, {sprite: new Sprite(doorTex)}) + }) + + this.queries.changedDoors.changed.forEach((entity: Entity) => { + let door = entity.getComponent(Door) + let pos = entity.getMutableComponent(Position) + let renderer = entity.getMutableComponent(SpriteRenderer) + + pos.value = door.open ? door.openPosition : door.closedPosition + renderer.sprite.texture = door.open ? door.openTex : door.closedTex + }) + } + + static queries = { + newDoors: { + components: [ Door ], + listen: { + added: true, + } + }, + changedDoors: { + components: [ Door, Position, SpriteRenderer ], + listen: { + changed: [ Door ], + } + } + } + queries: any; +} \ No newline at end of file diff --git a/Program/src/Systems/MovableSystem.ts b/Program/src/Systems/MovableSystem.ts new file mode 100644 index 0000000..e7c07a1 --- /dev/null +++ b/Program/src/Systems/MovableSystem.ts @@ -0,0 +1,31 @@ +import { System, Entity } from "ecsy" +import { canvasWidth, canvasHeight } from ".."; +import { Velocity } from "../Components/velocity"; +import { Position } from "../Components/position"; +import { SHAPE_HALF_SIZE } from "../constants"; + +// MovableSystem +export class MovableSystem extends System { + // This method will get called on every frame by default + execute(delta : number) { + // Iterate through all the entities on the query + this.queries.moving.results.forEach((entity: Entity) => { + var velocity = entity.getComponent(Velocity); + var position = entity.getMutableComponent(Position); + //if this system breaks, this is the error: scale might change the base component + position.value.add(velocity.value.scaled(delta)) + + if (position.value.x > canvasWidth + SHAPE_HALF_SIZE) position.value.x = - SHAPE_HALF_SIZE; + if (position.value.x < - SHAPE_HALF_SIZE) position.value.x = canvasWidth + SHAPE_HALF_SIZE; + if (position.value.y > canvasHeight + SHAPE_HALF_SIZE) position.value.y = - SHAPE_HALF_SIZE; + if (position.value.y < - SHAPE_HALF_SIZE) position.value.y = canvasHeight + SHAPE_HALF_SIZE; + }); + } + + static queries = { + moving: { + components: [Velocity, Position] + } + } + queries: any; +} \ No newline at end of file diff --git a/Program/src/Systems/RenderSystem.ts b/Program/src/Systems/RenderSystem.ts new file mode 100644 index 0000000..1da43d5 --- /dev/null +++ b/Program/src/Systems/RenderSystem.ts @@ -0,0 +1,12 @@ +import { System } from "ecsy" +import { app } from ".."; + +// MovableSystem +export class RenderSystem extends System { + priority: 100 + + // This method will get called on every frame by default + execute(_delta : number) { + app.renderer.render(app.stage); + } +} \ No newline at end of file diff --git a/Program/src/Systems/ShapeRenderSystem.ts b/Program/src/Systems/ShapeRenderSystem.ts new file mode 100644 index 0000000..5184f47 --- /dev/null +++ b/Program/src/Systems/ShapeRenderSystem.ts @@ -0,0 +1,36 @@ +import { System, Entity } from "ecsy"; +import { app } from ".."; +import { Position } from "../Components/position"; +import { Shape } from "../Components/shape"; + +// RendererSystem +export class ShapeRenderSystem extends System { + static queries = { + renderables: { + components: [Position, Shape], + } + }; + + queries: any; + + // This method will get called on every frame by default + execute(delta : number) { + + // Iterate through all the entities on the query + this.queries.renderables.results.forEach((entity: Entity) => { + var shape = entity.getComponent(Shape); + var position = entity.getComponent(Position); + this.drawShape(position, shape); + }); + } + + drawShape(position : Position, shape : Shape) { + if(!shape.onStage){ + app.stage.addChild(shape.shape); + shape.onStage = true; + } + + shape.shape.x = position.value.x; + shape.shape.y = position.value.y; + } +} \ No newline at end of file diff --git a/Program/src/Systems/SpriteSystem.ts b/Program/src/Systems/SpriteSystem.ts new file mode 100644 index 0000000..5367158 --- /dev/null +++ b/Program/src/Systems/SpriteSystem.ts @@ -0,0 +1,43 @@ +import { System, Entity } from "ecsy" +import { Position } from "../Components/position"; +import { SpriteRenderer } from "../Components/spriteRenderer"; +import { app } from ".."; + +// MovableSystem +export class SpriteSystem extends System { + priority: 90 + + // This method will get called on every frame by default + execute(delta : number) { + // Iterate through all the entities on the query + this.queries.sprites.added.forEach((entity: Entity) => { + let renderer = entity.getMutableComponent(SpriteRenderer) + let pos = entity.getComponent(Position) + renderer.sprite.position = pos.value + app.stage.addChild(renderer.sprite) + }) + + this.queries.sprites.removed.forEach((entity: Entity) => { + let renderer = entity.getRemovedComponent(SpriteRenderer) + app.stage.removeChild(renderer.sprite) + }) + + this.queries.sprites.changed.forEach((entity: Entity) => { + let renderer = entity.getMutableComponent(SpriteRenderer) + let pos = entity.getComponent(Position) + renderer.sprite.position = pos.value; + }) + } + + static queries = { + sprites: { + components: [ SpriteRenderer, Position ], + listen: { + added: true, + removed: true, + changed: [ Position ] + } + }, + } + queries: any; +} \ No newline at end of file diff --git a/Program/src/Systems/TestSystem.ts b/Program/src/Systems/TestSystem.ts new file mode 100644 index 0000000..86d4506 --- /dev/null +++ b/Program/src/Systems/TestSystem.ts @@ -0,0 +1,21 @@ +import { System, Entity } from "ecsy" +import { Door } from "../Components/door"; + +// MovableSystem +export class TestSystem extends System { + priority = -100 + // This method will get called on every frame by default + execute(delta : number) { + // Iterate through all the entities on the query + this.queries.doors.results.forEach((entity: Entity) => { + //entity.getMutableComponent(Door).open = Math.random() > 0.5 //violently vibrate door + }) + } + + static queries = { + doors: { + components: [ Door ] + }, + } + queries: any; +} \ No newline at end of file diff --git a/Program/src/constants.ts b/Program/src/constants.ts new file mode 100644 index 0000000..36fdec1 --- /dev/null +++ b/Program/src/constants.ts @@ -0,0 +1,4 @@ +export const NUM_ELEMENTS = 60 +export const SPEED_MULTIPLIER = 1 +export const SHAPE_SIZE = 5 +export const SHAPE_HALF_SIZE = SHAPE_SIZE / 2 \ No newline at end of file diff --git a/Program/src/index.ts b/Program/src/index.ts new file mode 100644 index 0000000..2d8e57b --- /dev/null +++ b/Program/src/index.ts @@ -0,0 +1,65 @@ +import { loadResources } from "./Resources" +import { Door } from "./Components/door" +import { DoorSystem } from "./Systems/DoorSystem" +import { SpriteSystem } from "./Systems/SpriteSystem" +import { Application, Ticker, settings, SCALE_MODES, Sprite, Loader } from "pixi.js" +import { World } from "ecsy" +import { RenderSystem } from "./Systems/RenderSystem" +import { TestSystem } from "./Systems/TestSystem" + +// Initialize pixi +export let canvasWidth = 81 +export let canvasHeight = 81 +export const app = new Application({ + width: canvasWidth, + height: canvasHeight, + backgroundColor: 0xFFFFFF, + resolution: 1, + antialias: false, +}) +document.body.appendChild(app.view) + +settings.SCALE_MODE = SCALE_MODES.NEAREST +settings.ROUND_PIXELS = true + +recalculateSize() + +window.addEventListener( 'resize', recalculateSize, false ) + +function recalculateSize(){ + let multiplier = Math.min((window.innerWidth/canvasWidth)|0, (window.innerHeight/canvasHeight)|0) + app.view.style.width = canvasWidth * multiplier + "px" + app.view.style.height = canvasHeight * multiplier + "px" +} + +// Create world and register the systems on it +export let world = new World(); +world + .registerSystem(TestSystem) //prio -100 + .registerSystem(DoorSystem) //prio 0 + .registerSystem(SpriteSystem) //prio 90 + .registerSystem(RenderSystem) //prio 100 + + +loadResources(init) + +function init(){ + let resources = Loader.shared.resources; + + //base sprites without entity representation + const bgTex = new Sprite(resources["Background"].texture) + app.stage.addChild(bgTex) + + //start entities + world.createEntity() + .addComponent(Door, {open: false, + openPosition: {x:38, y:2}, openTex: resources["Door"].spritesheet.textures[0], + closedPosition: {x:38, y:2}, closedTex: resources["Door"].spritesheet.textures[1]}) + + // Run! + Ticker.shared.add((delta : number) => { + let time = performance.now() + // Run all the systems + world.execute(delta, time) + }); +} diff --git a/Program/src/random.ts b/Program/src/random.ts new file mode 100644 index 0000000..193be8a --- /dev/null +++ b/Program/src/random.ts @@ -0,0 +1,45 @@ +import { Velocity } from "./Components/velocity" +import { Position } from "./Components/position" + +import { Vector } from "./Datatypes/vector" + +import { canvasWidth, canvasHeight } from "." +import { Point } from "./Datatypes/point" +import { SHAPE_HALF_SIZE, SHAPE_SIZE } from "./constants" + +// Some helper functions when creating the components +function getRandomVelocity(speedMultiplier: number): Velocity { + return { + value: new Vector( + speedMultiplier * (2 * Math.random() - 1), + speedMultiplier * (2 * Math.random() - 1) + ) + } +} + +function getRandomPosition(): Position{ + return { + value: new Point( + Math.random() * canvasWidth, + Math.random() * canvasHeight + ) + } +} + + +function getRandomShape() { + let graphics = new PIXI.Graphics() + if(Math.random() >= 0.5) { + graphics.beginFill(0x888888) + graphics.lineStyle(1, 0x222222) + graphics.drawCircle(0, 0, SHAPE_HALF_SIZE) + } else { + graphics.beginFill(0xf28d89) + graphics.lineStyle(1, 0x800904) + graphics.drawRect(-SHAPE_HALF_SIZE, -SHAPE_HALF_SIZE, SHAPE_SIZE, SHAPE_SIZE) + } + + return { + shape: graphics + } +} \ No newline at end of file diff --git a/Program/src/resources.ts b/Program/src/resources.ts new file mode 100644 index 0000000..366ebe3 --- /dev/null +++ b/Program/src/resources.ts @@ -0,0 +1,13 @@ +import { Loader } from "pixi.js" + + +export function loadResources(init: Function){ + Loader.shared.add("Door", "assets/Door.json") + .add("Background", "assets/Background.png") + .add("Human", "assets/Human.png") + .load(setup) + + function setup(loader: Loader){ + init() + } +} \ No newline at end of file diff --git a/Program/src/util.ts b/Program/src/util.ts new file mode 100644 index 0000000..32f5e43 --- /dev/null +++ b/Program/src/util.ts @@ -0,0 +1,19 @@ +import { Entity, ComponentConstructor, Component } from "ecsy"; + + +export function addOrSetComponent(entity: Entity, Component: ComponentConstructor, values: object) { + if(entity.hasComponent(Component)){ + //component exists, copy values into it + let component: any = entity.getMutableComponent(Component) + if(component.copy){ + component.copy(values) + } else { + for (var name in values) { + component[name] = values[name]; + } + } + } else { + //component doesn't exist, add new one + entity.addComponent(Component, values) + } +} \ No newline at end of file diff --git a/Program/style.css b/Program/style.css new file mode 100644 index 0000000..5f6da28 --- /dev/null +++ b/Program/style.css @@ -0,0 +1,11 @@ +html, body { + margin: 0; + padding: 0; +} + +canvas { + image-rendering: -moz-crisp-edges; + image-rendering: -webkit-crisp-edges; + image-rendering: pixelated; + image-rendering: crisp-edges; +} \ No newline at end of file diff --git a/Program/tsconfig.json b/Program/tsconfig.json new file mode 100644 index 0000000..4e510b3 --- /dev/null +++ b/Program/tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "sourceMap": true, + "target": "es6", + "moduleResolution": "Node" + } +} \ No newline at end of file diff --git a/Program/webpack.config.js b/Program/webpack.config.js new file mode 100644 index 0000000..9f4ff42 --- /dev/null +++ b/Program/webpack.config.js @@ -0,0 +1,26 @@ +const path = require('path'); +const HtmlWebpackPlugin = require('html-webpack-plugin'); + +module.exports = { + context: __dirname, + entry: './src/index.ts', + mode: 'development', + module: { + rules: [ + { + test: /\.ts?$/, + exclude: /node_modules/, + use: 'ts-loader', + }, + ] + }, + resolve: { + extensions: ['.ts', '.js'] + }, + plugins: [ + new HtmlWebpackPlugin({ + template: "index.html", + title: "Cabin Game", + }), + ], +} \ No newline at end of file diff --git a/src/assets/Background.png b/src/assets/Background.png deleted file mode 100644 index 6b6d49441fad5c4998a66f957edf771066070295..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6234 zcmZ8mdsxzU+qZSFZEV)+dCN3y`BdvMvm_6x=u?`mqbn=(1f~g2B{Mt${&df3YEEOV z)QAaFv#eCg1Lgr-SujN)kB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_B0lsbDT zYZ@}*;z}n2birU7S^(760au2Ou!AgC8&8fT+7@0lCMqw@7&YZuo#{dAZ< zrxzbp5gRzm=sJ6}>+8>41J9JB3S-qtJ@2k##_|T7s~4Jj1cBzvsp7}yDGYLl=xk0z z6%D-$3=9VwY)Sl&6}#Z#W9V9i1-973wWA-IdCnKFmn)*<)k0?gh&ODU4DzQscy?#J z<7{mO=iQ8Xq>s(7UWbq6<(HGeeC_kCZq5V_nlSt11dcLI`@qF@ZQUshUz^Qa)2RsO zx#|?BJQwi&xbr(`E{Qp&-?G81JNc%I*Oy$ikQt(&R_et)OZU_&wjeDqyfW_12iEsC zG*nn6Ya;li1LgHc^#*afEQoO&F;yuH+2YUNd+Uz_1Ome)V$Ohuvc?Wi&q{yKv2|C8 z16xoV4LKuAh6dT}RdvMua#(C&JPIe^J(!bDbtnxgx>yf=zHorzIoYvZb!l+c4NXxy zhaCq2gW@p3SYGYol { - var velocity = entity.getComponent(Velocity); - var position = entity.getMutableComponent(Position); - position.x += velocity.x * delta; - position.y += velocity.y * delta; - - if (position.x > canvasWidth + SHAPE_HALF_SIZE) position.x = - SHAPE_HALF_SIZE; - if (position.x < - SHAPE_HALF_SIZE) position.x = canvasWidth + SHAPE_HALF_SIZE; - if (position.y > canvasHeight + SHAPE_HALF_SIZE) position.y = - SHAPE_HALF_SIZE; - if (position.y < - SHAPE_HALF_SIZE) position.y = canvasHeight + SHAPE_HALF_SIZE; - }); - } - - static queries = { - moving: { - components: [Velocity, Position], - results: [] - } - } -} - - -// RendererSystem -class RendererSystem extends ECSY.System { - // This method will get called on every frame by default - execute(delta : number) { - - // Iterate through all the entities on the query - RendererSystem.queries.renderables.results.forEach((entity: Entity) => { - var shape = entity.getComponent(Shape); - var position = entity.getComponent(Position); - this.drawShape(position, shape); - }); - - //app.renderer.render(app.stage); - } - - drawShape(position : Position, shape : Shape) { - if(!shape.onStage){ - app.stage.addChild(shape.shape); - shape.onStage = true; - } - - shape.shape.x = position.x; - shape.shape.y = position.y; - } - - static queries = { - renderables: { - components: [Renderable, Shape], - results: [] - } - } -} - - -// Create world and register the systems on it -var world = new ECSY.World(); -world - .registerSystem(MovableSystem) - .registerSystem(RendererSystem); - -// Some helper functions when creating the components -function getRandomVelocity() { - return { - x: SPEED_MULTIPLIER * (2 * Math.random() - 1), - y: SPEED_MULTIPLIER * (2 * Math.random() - 1) - }; -} - -function getRandomPosition(){ - return { - x: Math.random() * canvasWidth, - y: Math.random() * canvasHeight - }; -} - - -function getRandomShape() { - let graphics = new PIXI.Graphics(); - if(Math.random() >= 0.5) { - graphics.beginFill(0x888888); - graphics.lineStyle(1, 0x222222); - graphics.drawCircle(0, 0, SHAPE_HALF_SIZE); - } else { - graphics.beginFill(0xf28d89); - graphics.lineStyle(1, 0x800904); - graphics.drawRect(-SHAPE_HALF_SIZE, -SHAPE_HALF_SIZE, SHAPE_SIZE, SHAPE_SIZE); - } - - return { - shape: graphics - }; -} - -for (let i = 0; i < NUM_ELEMENTS; i++) { - world - .createEntity() - .addComponent(Velocity, getRandomVelocity()) - .addComponent(Shape, getRandomShape()) - .addComponent(Position, getRandomPosition()) - .addComponent(Renderable) -} - -let time = 0 -// Run! -PIXI.Ticker.shared.add((delta : number) => { - time += delta; - // Run all the systems - world.execute(delta, time); -}); \ No newline at end of file diff --git a/src/package.json b/src/package.json deleted file mode 100644 index d51fc54..0000000 --- a/src/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "devDependencies": { - "typescript": "^3.7.5" - }, - "dependencies": { - "ecsy": "^0.2.2", - "pixi.js": "^5.2.1" - } -} diff --git a/src/tsconfig.json b/src/tsconfig.json deleted file mode 100644 index c919fc6..0000000 --- a/src/tsconfig.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "compilerOptions": { - /* Basic Options */ - "target": "ES6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */ - "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ - // "lib": [], /* Specify library files to be included in the compilation. */ - // "allowJs": true, /* Allow javascript files to be compiled. */ - // "checkJs": true, /* Report errors in .js files. */ - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - "declaration": true, /* Generates corresponding '.d.ts' file. */ - // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ - // "sourceMap": true, /* Generates corresponding '.map' file. */ - // "outFile": "./", /* Concatenate and emit output to single file. */ - "outDir": "lib", /* Redirect output structure to the directory. */ - // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - // "composite": true, /* Enable project compilation */ - // "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ - // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - - /* Strict Type-Checking Options */ - // "strict": true, /* Enable all strict type-checking options. */ - "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - "strictNullChecks": true, /* Enable strict null checks. */ - // "strictFunctionTypes": true, /* Enable strict checking of function types. */ - // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - - /* Additional Checks */ - // "noUnusedLocals": true, /* Report errors on unused locals. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - - /* Module Resolution Options */ - // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - // "types": [], /* Type declaration files to be included in compilation. */ - "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ - // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ - - /* Source Map Options */ - // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - - /* Experimental Options */ - // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - - /* Advanced Options */ - // "declarationDir": "lib" /* Output directory for generated declaration files. */ - } -}