MCPcopy Create free account
hub / github.com/codecombat/codecombat / parseDialogNode

Method parseDialogNode

ozaria/engine/cinematic/CameraSystem.js:46–63  ·  view source on GitHub ↗
(dialogNode)

Source from the content-addressed store, hash-verified

44 }
45
46 parseDialogNode (dialogNode) {
47 const commands = []
48 // Take a good guess at setting the camera to a reasonable default
49 // if it hasn't been set. We only set defaults for a zoom of 2.
50 if (this.lastCameraMove.zoom !== 2) {
51 return commands
52 }
53 if (this.lastCameraMove.pos.x !== 0 || this.lastCameraMove.pos.y !== 0) {
54 return commands
55 }
56 const speaker = getSpeaker(dialogNode)
57 if (speaker === 'left') {
58 commands.push(this.zoomToCommand(LEFT_SPEAKER_CAMERA_POS, 2))
59 } else if (speaker === 'right') {
60 commands.push(this.zoomToCommand(RIGHT_SPEAKER_CAMERA_POS, 2))
61 }
62 return commands
63 }
64
65 destroy () {
66 this.camera.destroy()

Callers

nothing calls this directly

Calls 2

zoomToCommandMethod · 0.95
getSpeakerFunction · 0.90

Tested by

no test coverage detected