File tree 3 files changed +9
-2
lines changed
3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change
1
+ src /* .js
2
+ src /* .js.map
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ export default class IdleSystem extends System {
46
46
console . log ( 'IsIdle' , entity . id ) ;
47
47
48
48
if ( component . properties . status === StateStatus . FINISHED ) {
49
+ console . log ( 'IsIdle finished and removed' ) ;
49
50
entity . removeComponent ( IsIdle ) ;
50
51
return ;
51
52
}
Original file line number Diff line number Diff line change @@ -40,6 +40,10 @@ export default class RenderSystem extends System {
40
40
}
41
41
42
42
const animationFrame = animation . frames [ component . properties . animationTick ] ;
43
+ const hitboxOffset = animation . hitboxOffset ;
44
+
45
+ const destPositionX = hitboxOffset ?. x ? position . properties . x - hitboxOffset . x : position . properties . x ;
46
+ const destPositionY = hitboxOffset ?. y ? position . properties . y - hitboxOffset . y : position . properties . y ;
43
47
44
48
if ( ! animationFrame ) {
45
49
throw new Error ( `Cannot find animation frame ${ component . properties . animationTick } for "${ component . properties . animationStateName } ".` ) ;
@@ -54,8 +58,8 @@ export default class RenderSystem extends System {
54
58
animationFrame . width ,
55
59
animationFrame . height ,
56
60
// dest
57
- position . properties . x ,
58
- position . properties . y ,
61
+ destPositionX ,
62
+ destPositionY ,
59
63
animationFrame . width ,
60
64
animationFrame . height
61
65
) ;
You can’t perform that action at this time.
0 commit comments