Skip to main content
ta-phaser-camera-work Implements camera controls, bounds, and follow behavior. Use proactively when setting up camera controls, camera bounds, or follow behavior.
Zur Installation springen Skills Marktplatz Entdecken und erkunden Sie KI-Skills, die von der Community erstellt wurden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Prompt kopierenPrompt-Details anzeigen Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
npx skills add https://github.com/feliperyba/ralph-orchestra --skill ta-phaser-camera-workDer Befehl bleibt in einer Zeile. Scrollen Sie horizontal, um ihn vor dem Kopieren vollständig zu prüfen.
Sie bevorzugen eine lokale Kopie? Laden Sie die Dateien herunter, die SkillsMP derzeit vorliegen.
ZIP herunterladen Herunterladen... Mehr aus diesem Repository Complete Developer workflow orchestration - task research sequence, implementation flow, validation gates, PRD synchronization, exit conditions.
Complete Game Designer workflow - skill invocation protocol, GDD creation, playtest flow with GDD review, design sessions. MUST load before starting assignments.
Complete PM Coordinator workflow - task assignment, project orchestration, PRD management, worker coordination. Use proactively when starting PM agent work.
Verwandte Berufe SOC
Basierend auf der SOC-Berufsklassifikation
name ta-phaser-camera-work description Implements camera controls, bounds, and follow behavior. Use proactively when setting up camera controls, camera bounds, or follow behavior. category techartist
Phaser Camera Work
"Cinematic camera controls that enhance gameplay and storytelling."
When to Use This Skill
Use when:
Setting up camera follow behavior
Implementing camera bounds
Creating cinematic sequences
Building camera transitions
Adding visual polish with camera
Quick Start
this .cameras .main .startFollow (this .player , true , 0.08 , 0.08 );
this .cameras .main .setBounds (0 , 0 , 2000 , 2000 );
Decision Framework
Player tracking startFollow() with lerpConfined area setBounds()Cinematic pan pan() tweenZoom effect Camera zoom tween Letterboxing Custom camera for UI
Progressive Guide
Level 1: Basic Camera Setup export class GameScene extends Phaser.Scene {
create ( ) {
const camera = this .cameras .main ;
camera.setBackgroundColor ("#2d2d2d" );
camera.setBounds (0 , 0 , 2000 , 1500 );
camera.startFollow (this .player , true , 0.1 , 0.1 );
camera.setZoom (1.5 );
camera.centerOn (this .player .x , this .player .y );
}
}
Level 2: Camera Follow Behaviors export class GameScene extends Phaser.Scene {
create ( ) {
this .cameras .main .startFollow (this .player , true , 1 , 1 );
this .cameras .main .startFollow (this .player , true , 0.05 , 0.05 );
this .cameras .main .startFollow (this .player , true , 0.1 , 0 );
this .cameras .main .startFollow (this .player , true , 0 , 0.1 );
this .cameras .main .startFollow (this .player , true , 0.08 , 0.08 );
this .cameras .main .setDeadzone (
this .scale .width * 0.3 ,
this .scale .height * 0.3 ,
);
}
}
Level 3: Cinematic Camera Moves export class CutsceneScene extends Phaser.Scene {
create ( ) {
const panToLocation = (x : number , y : number , duration = 2000 ) => {
this .tweens .add ({
targets : this .cameras .main ,
x : x,
y : y,
duration : duration,
ease : "Power2.easeInOut" ,
});
};
const focusOn = (target : Phaser .GameObjects .Sprite , duration = 1000 ) => {
this .tweens .add ({
targets : this .cameras .main ,
x : target.x ,
y : target.y ,
zoom : 2 ,
duration : duration,
ease : "Power2.easeInOut" ,
});
};
const dramaticReveal = ( ) => {
const camera = this .cameras .main ;
camera.setZoom (3 );
camera.centerOn (this .boss .x , this .boss .y );
this .tweens .add ({
targets : camera,
zoom : 1 ,
x : this .arenaCenter .x ,
y : this .arenaCenter .y ,
duration : 2000 ,
ease : "Cubic.easeOut" ,
});
};
const trackingShot = (path : Phaser .Curves .Path , duration = 3000 ) => {
this .tweens .add ({
targets : this .cameras .main ,
x : path.points [0 ].x ,
y : path.points [0 ].y ,
duration : duration,
ease : "Linear" ,
onUpdate : (tween : any ) => {
const progress = tween.progress ;
const point = path.getPoint (progress);
this .cameras .main .centerOn (point.x , point.y );
},
});
};
}
}
Level 4: Multi-Camera Setups export class GameScene extends Phaser.Scene {
private gameCamera!: Phaser .Cameras .Scene2D .Camera ;
private uiCamera!: Phaser .Cameras .Scene2D .Camera ;
private minimapCamera!: Phaser .Cameras .Scene2D .Camera ;
create ( ) {
this .gameCamera = this .cameras .main ;
this .gameCamera .setName ("game" );
this .gameCamera .setBounds (0 , 0 , 2000 , 2000 );
this .gameCamera .startFollow (this .player );
this .uiCamera = this .cameras .add (0 , 0 , this .scale .width , this .scale .height );
this .uiCamera .setName ("ui" );
this .uiCamera .setScrollFactor (0 );
this .uiCamera .setBackgroundColor ("rgba(0,0,0,0)" );
this .uiCamera .setZoom (1 );
this .minimapCamera = this .cameras .add (this .scale .width - 220 , 20 , 200 , 200 );
this .minimapCamera .setName ("minimap" );
this .minimapCamera .setBounds (0 , 0 , 2000 , 2000 );
this .minimapCamera .setZoom (0.1 );
this .add
.rectangle (this .scale .width - 120 , 120 , 204 , 204 , 0xffffff )
.setStrokeStyle (2 , 0x000000 )
.setScrollFactor (0 );
this .player .name = "player" ;
this .minimapCamera .ignore (this .someObjects );
}
}
Level 5: Advanced Camera Controller class CameraController {
private states = new Map <string , CameraState >();
private currentState : string = "default" ;
private tween ?: Phaser .Tweens .Tween ;
constructor (private camera : Phaser .Cameras .Scene2D .Camera ) {
this .setupStates ();
}
private setupStates ( ) {
this .states .set ("default" , {
follow : null ,
lerp : 0.08 ,
zoom : 1 ,
deadzone : { x : 0.3 , y : 0.3 },
});
this .states .set ("combat" , {
follow : null ,
lerp : 0.12 ,
zoom : 1.1 ,
deadzone : { x : 0.2 , y : 0.2 },
});
this .states .set ("sprint" , {
follow : null ,
lerp : 0.15 ,
zoom : 1.2 ,
deadzone : { x : 0.1 , y : 0.1 },
});
this .states .set ("cinematic" , {
follow : null ,
lerp : 1 ,
zoom : 1 ,
deadzone : { x : 0 , y : 0 },
});
}
setState (stateName : string , duration = 500 ) {
const state = this .states .get (stateName);
if (!state || stateName === this .currentState ) return ;
this .currentState = stateName;
if (this .tween ) {
this .tween .destroy ();
}
this .tween = this .camera .scene .tweens .add ({
targets : this .camera ,
zoom : state.zoom ,
duration : duration,
ease : "Power2.easeOut" ,
onUpdate : () => {
this .camera .setLerp (state.lerp , state.lerp );
if (state.deadzone ) {
const w = this .camera .width * state.deadzone .x ;
const h = this .camera .height * state.deadzone .y ;
this .camera .setDeadzone (w, h);
}
},
});
}
setFollowTarget (target : Phaser .GameObjects .GameObject ) {
this .camera .startFollow (target, true , 0.08 , 0.08 );
}
lookAt (
target : Phaser .Math .Vector2 | Phaser .GameObjects .GameObject ,
duration = 500 ,
) {
const x =
target instanceof Phaser .GameObjects .GameObject ? target.x : target.x ;
const y =
target instanceof Phaser .GameObjects .GameObject ? target.y : target.y ;
this .tween = this .camera .scene .tweens .add ({
targets : this .camera ,
x : x,
y : y,
duration : duration,
ease : "Power2.easeInOut" ,
});
}
shake (intensity : number , duration : number ) {
const startTime = Date .now ();
const update = ( ) => {
const elapsed = Date .now () - startTime;
if (elapsed >= duration) {
this .camera .resetFX ();
return ;
}
const progress = elapsed / duration;
const currentIntensity = intensity * (1 - progress);
this .camera .shake (16 , currentIntensity);
this .camera .scene .time .delayedCall (16 , update);
};
update ();
}
zoomTo (targetZoom : number , duration = 500 ) {
this .tween = this .camera .scene .tweens .add ({
targets : this .camera ,
zoom : targetZoom,
duration : duration,
ease : "Power2.easeOut" ,
});
}
}
Camera Methods Reference Method Parameters Description startFollow(target)target, roundPx, lerpX, lerpY Follow game object stopFollow()- Stop following setZoom(level)number Set zoom level setBounds(x, y, w, h)bounds Set world bounds setDeadzone(w, h)size Set no-move zone pan(x, y, duration)position, ms Pan to position setLerp(lerpX, lerpY)0-1 values Set follow smoothness setScrollFactor(x, y)0-1 values Set parallax centerOn(x, y)position Center camera ignore(objs)array Don't render objects
Anti-Patterns
Set lerp too high (jittery) or too low (laggy)
Forget camera bounds for open worlds
Use zoom without considering gameplay impact
Mix coordinate systems when panning
| Ignore camera in multi-camera setups
| Change camera during player input
✅ DO:
| Tune lerp for game feel
| Set bounds for world limits
| Test gameplay at different zoom levels
| Use consistent coordinate systems
| Name cameras for debugging
| Change camera between gameplay segments
Camera Effect Presets const CAMERA_PRESETS = {
platformer : {
followLerp : 0.08 ,
zoom : 1 ,
deadzone : { x : 0.3 , y : 0.4 },
},
topdown : {
followLerp : 0.1 ,
zoom : 1.2 ,
deadzone : { x : 0.2 , y : 0.2 },
},
bullethell : {
followLerp : 0.05 ,
zoom : 1 ,
deadzone : { x : 0.1 , y : 0.1 },
},
cinematic : {
followLerp : 0.03 ,
zoom : 1 ,
deadzone : { x : 0.05 , y : 0.05 },
},
};
Checklist
Reference