Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions game/client_types/autoplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

module.exports = function(treatmentName, settings, stager, setup, gameRoom) {

var ngc = require('nodegame-client');
var game, stager;
game = gameRoom.getClientType('player');
const ngc = require('nodegame-client');

var stager;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just remove var stager


let game = gameRoom.getClientType('player');
game.nodename = 'autoplay';

game.env.allowTimeup = true;
Expand Down Expand Up @@ -42,7 +42,7 @@ module.exports = function(treatmentName, settings, stager, setup, gameRoom) {
}
}
});


// Gameover will be executed only in 'auto' mode.
stager.setOnGameOver(function() {
Expand All @@ -51,10 +51,6 @@ module.exports = function(treatmentName, settings, stager, setup, gameRoom) {
window.close();
}, 60000);
});

return game;
};




10 changes: 4 additions & 6 deletions game/client_types/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
* http://www.nodegame.org
* ---
*/
var ngc = require('nodegame-client');
var stepRules = ngc.stepRules;
const ngc = require('nodegame-client');
const stepRules = ngc.stepRules;

module.exports = function(treatmentName, settings, stager, setup, gameRoom) {

Expand Down Expand Up @@ -48,7 +48,7 @@ module.exports = function(treatmentName, settings, stager, setup, gameRoom) {
}
node.game.lastDepartureTime = departure;
node.game.decisionMade(decision);
setTimeout(function() {
node.timer.setTimeout(function() {
W.getElementById('decision').click();
}, 2000);
};
Expand Down Expand Up @@ -292,7 +292,5 @@ module.exports = function(treatmentName, settings, stager, setup, gameRoom) {
console.log('PHANTOMJS EXITING');
}
});

};


};