File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
Client/objects/oEntityManager
TypescriptServer/src/concepts Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,13 @@ for(i = 0; i < l; i++) {
122122 inst.x = entity.x
123123 inst.y = entity.y
124124
125+ if (entity[$ " fx" ]) {
126+ inst.image_xscale *= -1
127+ }
128+ if (entity[$ " fy" ]) {
129+ inst.image_yscale *= -1
130+ }
131+
125132 inst.state = state
126133
127134 // set the speed
Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ export type SerializedEntity = {
3333 a : number ,
3434 spd ?: Point ,
3535 st : number , // state
36+ fx ?: boolean , // flip
37+ fy ?: boolean ,
3638
3739 p ?: { // custom variables
3840 [ name : string ] : any
@@ -344,7 +346,7 @@ class Entity extends EventEmitter {
344346 }
345347
346348 public serialize ( ) :SerializedEntity {
347- return {
349+ let struct : SerializedEntity = {
348350 id : this . id ,
349351 t : this . type ,
350352 obj : this . object_name ,
@@ -357,6 +359,14 @@ class Entity extends EventEmitter {
357359 p : this . props , // uses a getter for props
358360 st : this . state
359361 }
362+
363+ if ( this . flip . x )
364+ struct . fx = true ;
365+ if ( this . flip . y )
366+ struct . fy = true ;
367+
368+
369+ return struct ;
360370 }
361371
362372 public bundle ( ) {
You can’t perform that action at this time.
0 commit comments