diff --git a/src/gameObjects/reportablePhoto.js b/src/gameObjects/reportablePhoto.js index e08e2b8..29c008b 100644 --- a/src/gameObjects/reportablePhoto.js +++ b/src/gameObjects/reportablePhoto.js @@ -49,6 +49,7 @@ export default class ReportablePhoto extends Phaser.GameObjects.Container { this.speed = speed; // Foto + this.frame = frame; this.image = this.scene.add.image(0, 0, 'photos', frame); this.add(this.image); diff --git a/src/scenes/gameLoop/day1/nightmareDay1.js b/src/scenes/gameLoop/day1/nightmareDay1.js index f385894..f41504e 100644 --- a/src/scenes/gameLoop/day1/nightmareDay1.js +++ b/src/scenes/gameLoop/day1/nightmareDay1.js @@ -1,3 +1,5 @@ +import { gameObjectXapiTracker } from '../../../lib/xapi.js'; +import { GAMEOBJECTTYPE } from '../../../xAPITracker/HighLevel/GameObject.js'; import NightmareMinigame from '../baseScenarios/nightmareMinigame.js' export default class NightmareDay1 extends NightmareMinigame { @@ -104,10 +106,11 @@ export default class NightmareDay1 extends NightmareMinigame { chair.removeInteractive(); if (node) { + gameObjectXapiTracker.sendStatement(gameObjectXapiTracker.Interacted("chair_with_dialog", GAMEOBJECTTYPE.ITEM)); this.lastTouchedChair = chair; this.dialogManager.setNode(node); - } - else { + } else { + gameObjectXapiTracker.sendStatement(gameObjectXapiTracker.Interacted("chair_without_dialog", GAMEOBJECTTYPE.ITEM)); this.chairFadesOut(chair); } }); diff --git a/src/scenes/gameLoop/day2/nightmareDay2.js b/src/scenes/gameLoop/day2/nightmareDay2.js index e5a333b..1adce99 100644 --- a/src/scenes/gameLoop/day2/nightmareDay2.js +++ b/src/scenes/gameLoop/day2/nightmareDay2.js @@ -1,3 +1,5 @@ +import { gameObjectXapiTracker } from '../../../lib/xapi.js'; +import { GAMEOBJECTTYPE } from '../../../xAPITracker/HighLevel/GameObject.js'; import NightmareMinigame from '../baseScenarios/nightmareMinigame.js'; import ChairWithGum from '../../../gameObjects/chairWithGum.js'; @@ -168,6 +170,9 @@ export default class NightmareDay2 extends NightmareMinigame { gum.setInteractive({ useHandCursor: true }); gum.on('pointerup', () => { + var statement = gameObjectXapiTracker.Interacted("gum", GAMEOBJECTTYPE.ITEM); + gameObjectXapiTracker.sendStatement(statement); + // Si se clica, se elmina del grupo y se destruye this.gums.remove(gum, true, true); }) diff --git a/src/scenes/gameLoop/day4/nightmareDay4.js b/src/scenes/gameLoop/day4/nightmareDay4.js index eee03fe..578beae 100644 --- a/src/scenes/gameLoop/day4/nightmareDay4.js +++ b/src/scenes/gameLoop/day4/nightmareDay4.js @@ -1,3 +1,5 @@ +import { gameObjectXapiTracker } from '../../../lib/xapi.js'; +import { GAMEOBJECTTYPE } from '../../../xAPITracker/HighLevel/GameObject.js'; import NightmareMinigame from '../baseScenarios/nightmareMinigame.js'; import ReportablePhoto from '../../../gameObjects/reportablePhoto.js'; @@ -74,6 +76,7 @@ export default class NightmareDay4 extends NightmareMinigame { // Se crea la foto segun los parametros let photo = new ReportablePhoto(this, photosParams.scale, this.sprites[randomSprite], photosParams.speed, photosParams.minTouches, photosParams.maxTouches, () => { + gameObjectXapiTracker.sendStatement(gameObjectXapiTracker.Interacted("photo_" + photo.frame, GAMEOBJECTTYPE.ITEM)); // Cuando se ha pulsado un numero determinado de clics... // Se produce un terremoto if (this.shakeCompleted) {