damageApply(choDevice, curEvent.damageTaken, "damage");
if (options.platform == "Android") {
var data = {
achievementId: "CgkIya77kP0DEAIQGQ"
//GoodNews
};
cordova.plugins.playGamesServices.unlockAchievement(data, function () {
// On success
}, function () {
// On error
});
};
Could probably be combined into a function, the code that repeats over. I have an idea. Maybe something like
if (options.platfom=="Android") {
unlockAchievement(CgkIya77kP0DEAIQGQ");
}
function unlockAchievement(achievementID){
cordova.plugins.playGamesServices.unlockAchievement(data, function () {
// On success
}, function () {
// On error
});
}
I see a lot of code like this: https://github.com/Einharr/SeedshipRelaunchWeb/blob/4c3405af0f7f7878b7bef722eba3262f822e70ce/data/eventsFunc.js#L1873
Could probably be combined into a function, the code that repeats over. I have an idea. Maybe something like
Much less code.