Untitled
unknown
plain_text
2 years ago
1.7 kB
5
Indexable
var passwordHolder = "";
var allowedPass = [];
var notPass = [];
onEvent("passwordInput", "input", function() {
passwordHolder = getText("passwordInput");
return passwordHolder;
});
function passwordLength (passwordHolder) {
for (var i = 0; i < passwordHolder.length ; i++) {
if (8 <= passwordHolder.length) {
appendItem(allowedPass, passwordHolder);
setText("logs","Success: " + allowedPass);
setScreen("successScreen");
playSound("sound://category_achievements/lighthearted_bonus_objective_4.mp3");
break;
} else {
appendItem(notPass, passwordHolder);
setText("logs","Failed: " + notPass);
setScreen("failureScreen");
playSound("wrong-answer-126515.mp3");
break;
}
}
}
onEvent("checkPassword", "click", function( ) {
passwordLength(passwordHolder); //AI fixed a minor code error
playSound("sound://category_hits/puzzle_game_organic_metal_tile_hit_1.mp3");
});
onEvent("successReturn", "click", function( ) {
playSound("sound://category_hits/puzzle_game_organic_metal_tile_hit_1.mp3");
setScreen("checkScreen");
});
onEvent("failureReturn", "click", function( ) {
playSound("sound://category_hits/puzzle_game_organic_metal_tile_hit_1.mp3");
setScreen("checkScreen");
});
onEvent("startButton", "click", function( ) {
playSound("sound://category_hits/puzzle_game_organic_metal_tile_hit_1.mp3");
setScreen("checkScreen");
});
onEvent("logButton", "click", function( ) {
setScreen("logScreen");
});
onEvent("checkBack", "click", function( ) {
setScreen("checkScreen");
});
//Sound Effects Used
//pixabay.com/sound-effects/wrong-answer-126515/ credit to UNIVERSEFIELD
Editor is loading...
Leave a Comment