kippy 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/physics.js +5 -2
  2. package/package.json +1 -1
package/dist/physics.js CHANGED
@@ -179,6 +179,11 @@ export class Physics {
179
179
  // Check collision
180
180
  const collisionResult = this.checkCollision(entity, other);
181
181
  if (collisionResult.info) {
182
+ // Wake if contacting an awake body
183
+ if (!entity.body?.isSleeping || !other.body?.isSleeping) {
184
+ entity.body?.wake();
185
+ other.body?.wake();
186
+ }
182
187
  // Track collision
183
188
  if (!currentCollisions.has(entity)) {
184
189
  currentCollisions.set(entity, new Map());
@@ -189,8 +194,6 @@ export class Physics {
189
194
  this.collisionPairs.get(other)?.has(entity));
190
195
  if (!wasColliding) {
191
196
  // ENTER
192
- entity.body?.wake();
193
- other.body?.wake();
194
197
  if (collisionResult.isTrigger) {
195
198
  entity.onTriggerEnter?.(other);
196
199
  other.onTriggerEnter?.(entity);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kippy",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Kippy 2D web game engine for JS",
5
5
  "keywords": [
6
6
  "kippy",