Skip to content

Commit

Permalink
Remove AI
Browse files Browse the repository at this point in the history
  • Loading branch information
breville committed Sep 17, 2023
1 parent 8a5d74d commit a5684c7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 28 deletions.
3 changes: 0 additions & 3 deletions src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,6 @@ module.exports = class DanceAPI {
changePropEachBy: (group, property, val) => {
return nativeAPI.changePropEachBy(group, property, val);
},
ai: value => {
nativeAPI.ai(value);
},
};
}
};
25 changes: 0 additions & 25 deletions src/p5.dance.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ module.exports = class DanceParty {
i18n = {
measure: () => 'Measure:',
},
doAi,
// For testing: Can provide a custom resource loader class
// to load fixtures and/or isolate us entirely from network activity
resourceLoader = new ResourceLoader(),
Expand Down Expand Up @@ -109,8 +108,6 @@ module.exports = class DanceParty {
this.world.SPRITE_NAMES = constants.SPRITE_NAMES;
this.world.MOVE_NAMES = constants.MOVE_NAMES;

this.doAi = doAi;

if (spriteConfig) {
spriteConfig(this.world);
}
Expand Down Expand Up @@ -1119,28 +1116,6 @@ module.exports = class DanceParty {
}, this);
}

ai(value) {
// We can use AI to transform this value into something usable by
// dance party and send that back over to dance party's native
// handler.

const response = this.doAi(value);
console.log('do AI', value, response);
}

handleAi(result) {
console.log('handle AI', result);

const params = JSON.parse(result);

this.setBackgroundEffect(params.backgroundEffect, params.backgroundColor);
this.setForegroundEffect(params.foregroundEffect);

if (params.setDancer) {
this.makeNewDanceSprite('MOOSE', 'harold', null);
}
}

// Music Helpers

getEnergy(range) {
Expand Down

0 comments on commit a5684c7

Please sign in to comment.