
Security News
Ruby's Bundler 4.0.18 Extends Cooldown to bundle lock and bundle cache
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.
@martini-kit/phaser
Advanced tools
Multiplayer without networking. Phaser 3 adapter with automatic sprite synchronization.
Multiplayer without networking.
Phaser 3 adapter for martini-kit that automatically syncs sprites, physics, and game state across clients with zero networking code.
npm install @martini-kit/phaser @martini-kit/core phaser
import { defineGame } from '@martini-kit/core';
import { PhaserAdapter } from '@martini-kit/phaser';
import Phaser from 'phaser';
// Define your game logic
const game = defineGame({
initialState: { players: {} },
actions: {
move: (state, { playerId, x, y }) => {
state.players[playerId] = { x, y };
}
}
});
// Create Phaser scene with automatic sync
class GameScene extends Phaser.Scene {
adapter!: PhaserAdapter;
create() {
// Initialize adapter - handles all networking
this.adapter = new PhaserAdapter(this, runtime);
// Create sprites normally - they sync automatically!
runtime.onPlayerJoin((playerId) => {
const sprite = this.physics.add.sprite(100, 100, 'player');
this.adapter.trackSprite(playerId, sprite);
});
// Handle input
this.input.on('pointermove', (pointer) => {
runtime.dispatchAction('move', {
x: pointer.x,
y: pointer.y
});
});
}
update() {
// Sprites automatically update from state - no manual sync needed!
this.adapter.syncSprites((playerId) => runtime.state.players[playerId]);
}
}
The adapter automatically tracks sprite properties and syncs them across clients:
// Host: Create and move sprite with physics
const sprite = this.physics.add.sprite(100, 100, 'player');
sprite.setVelocityX(200);
// Client: Sprite automatically mirrors the position/rotation - no code needed!
Pre-built movement patterns for common game types:
import { InputManager } from '@martini-kit/phaser';
const inputManager = new InputManager(this, runtime, {
profile: 'platformer', // or 'top-down', 'racing', 'twin-stick'
speed: 200,
jumpForce: 400
});
// Automatically handles WASD/Arrow keys and dispatches actions
Use Phaser's physics normally - the adapter syncs the results:
// Host: Real physics simulation
this.physics.add.collider(player, platforms);
player.setVelocityX(200);
// Client: Sees the result automatically
// No physics simulation needed on client side
import { CollisionManager } from '@martini-kit/phaser';
const collisionManager = new CollisionManager(this, runtime, {
rules: [
{ group1: 'players', group2: 'enemies', action: 'damage' },
{ group1: 'players', group2: 'platforms', action: 'collide' }
]
});
import { HealthBarManager } from '@martini-kit/phaser';
const healthBars = new HealthBarManager(this, {
width: 50,
height: 6,
offsetY: -30
});
healthBars.attach(sprite, playerId);
import { createCameraFollower } from '@martini-kit/phaser';
const follower = createCameraFollower(this, {
lerp: 0.1,
deadzone: { width: 200, height: 200 }
});
follower.follow(playerSprite);
Apache-2.0 © Blueprint Lab
FAQs
Multiplayer without networking. Phaser 3 adapter with automatic sprite synchronization.
We found that @martini-kit/phaser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.

Company News
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.