File tree 2 files changed +18
-1
lines changed
Client/objects/oEntityManager
TypescriptServer/src/concepts
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++) {
122
122
inst.x = entity.x
123
123
inst.y = entity.y
124
124
125
+ if (entity[$ " fx" ]) {
126
+ inst.image_xscale *= -1
127
+ }
128
+ if (entity[$ " fy" ]) {
129
+ inst.image_yscale *= -1
130
+ }
131
+
125
132
inst.state = state
126
133
127
134
// set the speed
Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ export type SerializedEntity = {
33
33
a : number ,
34
34
spd ?: Point ,
35
35
st : number , // state
36
+ fx ?: boolean , // flip
37
+ fy ?: boolean ,
36
38
37
39
p ?: { // custom variables
38
40
[ name : string ] : any
@@ -344,7 +346,7 @@ class Entity extends EventEmitter {
344
346
}
345
347
346
348
public serialize ( ) :SerializedEntity {
347
- return {
349
+ let struct : SerializedEntity = {
348
350
id : this . id ,
349
351
t : this . type ,
350
352
obj : this . object_name ,
@@ -357,6 +359,14 @@ class Entity extends EventEmitter {
357
359
p : this . props , // uses a getter for props
358
360
st : this . state
359
361
}
362
+
363
+ if ( this . flip . x )
364
+ struct . fx = true ;
365
+ if ( this . flip . y )
366
+ struct . fy = true ;
367
+
368
+
369
+ return struct ;
360
370
}
361
371
362
372
public bundle ( ) {
You can’t perform that action at this time.
0 commit comments