src/objects/Coin.tsimport { Container, Graphics } from 'pixi.js';import * as TWEEN from '@tweenjs/tween.js';import type RAPIER from '@dimforge/rapier2d-compat';import { COIN_RADIUS, COLORS } from '../constants';import type { PhysicsWorld } from '../systems/PhysicsWorld';/*** Sensor pickup. Fixed Rapier body with a sensor ball collider that fires a* collision-start event when the player overlaps it. The display object is a* tiny Graphics circle that bobs via tween.js.*/export class Coin extends Container {readonly body: RAPIER.RigidBody;readonly collider: RAPIER.Collider;private bobTween?: TWEEN.Tween<Container>;constructor(private physics: PhysicsWorld,x: number,y: number,
Showing the first 20 lines.
Get full code