]> git.r.bdr.sh - rbdr/sumo/blobdiff - lib/systems/physics_to_attributes.js
Fix positioning and lessen friction (#8)
[rbdr/sumo] / lib / systems / physics_to_attributes.js
index a49a16bd7db8d5f70b68d5df1e23f27b5775be13..e054710df2ff6ff5d41419f17851c912b0660d99 100644 (file)
@@ -1,6 +1,7 @@
 import { System } from '@serpentity/serpentity';
 
 import PhysicalWithAttributesNode from '../nodes/physical_with_attributes';
+import Config from '../config';
 
 /**
  * Distribuets physics data to the related components
@@ -64,8 +65,8 @@ export default class PhysicsToAttributesSystem extends System {
   update(currentFrameDuration) {
 
     for (const physicalEntity of this.physicalEntities) {
-      physicalEntity.position.x = physicalEntity.body.body.position.x;
-      physicalEntity.position.y = physicalEntity.body.body.position.y;
+      physicalEntity.position.x = physicalEntity.body.body.position.x * Config.meterSize;
+      physicalEntity.position.y = physicalEntity.body.body.position.y * Config.meterSize;
       physicalEntity.angle.angle = physicalEntity.body.body.angle;
     }
   }