Example #1
0
Introduction.prototype.reset = function() {
    console.log('reset introduction');
    board.setVerb({verb: {name: ''}});
    this.screen.root = this.root;
    board.hide();
    board.talk({
        sentences: [
            {text: 'Here are the results for this 33rd edition of "The Best Pie Eater"'},
            {text: 'John, with 9 pies : third place'},
            {text: 'Jim, with 12 pies : second place'},
            {text: 'Tom, with 12 pies : second place, ex-aequo'},
            {text: 'Peter, with 12 pies : second place, ex-aequo'},
            {text: 'Tom, with 12 pies : second place, ex-aequo'},
            {text: 'William, with 12 pies : second place, ex-aequo'},
            {text: 'Jonathan, with 12 pies : second place, ex-aequo'},
            {text: 'David, with 12 pies : second place, ex-aequo'},
            {text: 'Colin, with 12 pies : second place, ex-aequo'},
            {text: 'Philip, with 12 pies : second place, ex-aequo'},
            {text: 'Mickael, with 12 pies : second place, ex-aequo'},
            {text: 'Barry, with 12 pies : second place, ex-aequo'},
            {text: 'You got to be kidding me ...', talker: 'barry'},
            {text: 'And Chuck, with 15 pies, first place.'},
            {text: 'Congratulations, all of you'},
            {text: 'I need to talk to the judges', talker: 'barry'},
        ],
        callback: function () {
            loop.setMode({mode: stadium});
        }
    })
};
Example #2
0
Bin.prototype.look = function() {
    if (!board.is('bin:look')) {
        board.talk({
            sentences: [
                {text: 'I have to say', talker: 'barry'},
                {text: 'I never do that', talker: 'barry'},
                {text: 'NEVER', talker: 'barry'},
                {text: 'But ... in my situation', talker: 'barry'},
                {text: '...', talker: 'barry'},
                {text: 'erk erk erk', talker: 'barry'},
                {text: 'Oh my ... oh crap', talker: 'barry'},
                {text: 'Something is moving in there ?', talker: 'barry'},
                {text: '...', talker: 'barry'},
            ],
            callback: function () {
                board.addItem({item: items.doll});
                board.addItem({item: items['dry-pen']});
                board.notify({text: '2 OBJECTS FOUND'});
                board.set('bin:look', true);
            }
        });
    } else {
        board.notify({text: 'Enough of that for me today, thanks.', talker: 'barry'});

    }
};
Example #3
0
Pizzaiolo.prototype.talk = function () {
    if (!board.is('pizzaiolo:talk:0')) {
        board.talk({
            sentences: [
                {text: 'Hi', talker: 'barry'},
                {text: 'Hello Sir ! Welcome to Pizza Nut', talker: 'pizzaiolo'},
                {text: 'Nut ? You mean Pizza ...', talker: 'barry'},
                {text: 'No sir', talker: 'pizzaiolo'},
            ],
            callback: function () {
                board.set('pizzaiolo:talk:0', true);
            }
        });
    } else if (!board.is('pizzaiolo:talk:1')) {
        board.talk({
            sentences: [
                {text: 'Hi', talker: 'barry'},
                {text: 'Hello Sir ! Welcome to Pizza Nut', talker: 'pizzaiolo'},
                {text: 'What kind of pizza do you have ?', talker: 'barry'},
                {text: 'We have plenty of flavours sir !', talker: 'pizzaiolo'},
                {text: 'We have salted, sweet', talker: 'pizzaiolo'},
                {text: 'With meat, or with bacon', talker: 'pizzaiolo'},
                {text: 'With laurel, that one comes from my neighbor\'s garden', talker: 'pizzaiolo'},
            ],
            callback: function () {
                board.set('pizzaiolo:talk:1', true);
            }
        });
    }  else if (!board.is('pizzaiolo:talk:2')) {
        board.talk({
            sentences: [
                {text: 'Hi', talker: 'barry'},
                {text: 'Hello Sir ! Welcome to Pizza Nut', talker: 'pizzaiolo'},
                {text: 'Sorry, I don\'t remember your pizzas flavours', talker: 'barry'},
                {text: 'No probleme sir !', talker: 'pizzaiolo'},
                {text: 'We have salted, sweet', talker: 'pizzaiolo'},
                {text: 'With meat, or with bacon', talker: 'pizzaiolo'},
                {text: 'With laurel, that one comes from my neighbor\'s garden', talker: 'pizzaiolo'},
            ],
            callback: function () {
                board.set('pizzaiolo:talk:2', true);
            }
        });
    } else if (!board.is('pizzaiolo:talk:3')) {
        board.talk({
            sentences: [
                {text: 'Hi', talker: 'barry'},
                {text: 'Hello Sir ! Welcome to Pizza Nut', talker: 'pizzaiolo'},
                {text: 'Could you tell me another time', talker: 'barry'},
                {text: 'Okay ... But maybe you could note it this time sir ?', talker: 'pizzaiolo'},
                {text: 'We have salted, sweet', talker: 'pizzaiolo'},
                {text: 'With meat, or with bacon', talker: 'pizzaiolo'},
                {text: 'With laurel, that one comes from my neighbor\'s garden', talker: 'pizzaiolo'},
            ],
            callback: function () {
                board.set('pizzaiolo:talk:3', true);
            }
        });
    } else if (!board.is('pizzaiolo:talk:4')) {
        board.talk({
            sentences: [
                {text: 'Hi', talker: 'barry'},
                {text: 'Hello Sir ! Welcome to Pizza Nut', talker: 'pizzaiolo'},
                {text: 'Sorry, another time ?', talker: 'barry'},
                {text: 'Sorry sir, but I have to work', talker: 'pizzaiolo'},
                {text: 'Take my business card', talker: 'pizzaiolo'},
                {text: 'I wrote the list for you', talker: 'pizzaiolo'},
            ],
            callback: function () {
                board.set('pizzaiolo:talk:4', true);
                board.addItem({item: items['pizzaiolo-business-card']});
            }
        });
    } else {
         board.talk({sentences: [
            {text: 'Hi', talker: 'barry'},
            {text: 'Sorry sir I have no time to talk', talker: 'pizzaiolo'}
        ]});
    }
};