Skip to content

Commit

Permalink
Bug Fix, Patches.
Browse files Browse the repository at this point in the history
Added reset on end level, added secret level, fixed error on input when on end level
  • Loading branch information
Gam3rrXD authored Jan 1, 2023
1 parent cf300ad commit 1c83b96
Showing 1 changed file with 54 additions and 17 deletions.
71 changes: 54 additions & 17 deletions games/Robot_Party_Basic_Buildv1.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,20 @@
@title: Robot_Party | Basic Build v1
@author: Gam3rrXD
*/
function reset(){
console.log("debug");
min = 0;
seconds = 0;
level=0;
isend = 0;
button_press = 0;
reset_used = 0;
var lol = setInterval(function() { seconds++; if (seconds == 60) {min++; seconds = 0;} addText(min + ":" + seconds, { x:14 , y:1 , color: color`0` })} , 1000);
}
let button_press = 0;
let reset_used = 0;
let min = 0;
let isend = 0;
var seconds = 0;
var lol = setInterval(function() { seconds++; if (seconds == 60) {min++; seconds = 0;} addText(min + ":" + seconds, { x:14 , y:1 , color: color`0` })} , 1000);

Expand Down Expand Up @@ -247,6 +259,15 @@ pfff
wfff
wfbg
wwww`];
const secr_lvl = [map`
pfwg
wfwf
ffbf
ffff`, map`
gwww
ffbw
fbff
gwwp`]
const end = [map`
wwww
wwww
Expand All @@ -268,34 +289,49 @@ setPushables({

// Movement + Sounds
onInput("w", () => {
button_press++;
playTune(move, 1)
getFirst(player).y -= 1;
if (isend == 0) {
button_press++;
playTune(move, 1)
getFirst(player).y -= 1; }
});

onInput("a", () => {
button_press++;
playTune(move, 1)
getFirst(player).x -= 1;
if (isend == 0) {
button_press++;
playTune(move, 1)
getFirst(player).x -= 1;}
});

onInput("s", () => {
button_press++;
playTune(move, 1)
getFirst(player).y += 1;
if (isend == 0) {
button_press++;
playTune(move, 1)
getFirst(player).y += 1;
}
});

onInput("d", () => {
button_press++;
playTune(move, 1)
getFirst(player).x += 1;
if (isend == 0) {
button_press++;
playTune(move, 1)
getFirst(player).x += 1;
}
});
onInput("i", () => {
if (isend == 0)
{
setMap(secr_lvl[0])
}
});

// Reset Level + Sound

onInput("j", () => {
button_press++;
const currentLevel = levels[level];
reset_used++;
if (isend == 1)
{
reset()
}
let currentLevel = levels[level];
if (currentLevel !== undefined) {
clearText("");
playTune(rese)
Expand All @@ -322,9 +358,10 @@ afterInput(() => {
} else {
clearInterval(lol);
setMap(endLevel)
isend++;
clearText()
if (endlvl == 1) { addText("You found ", { y: 4, color: color`4` }); addText("the hidden level!", { y: 5, color: color`4` }); addText("Time Taken: " + min + ":" + seconds , { y: 7, color: color`5` }); addText("Pressed: " + button_press , { y: 9, color: color`H` }); playTune(secnd, Infinity); }
else { addText("Winner!", { y: 3, color: color`3` }); addText("Time Taken: " + min + ":" + seconds , { y: 6, color: color`5` }); addText("Pressed: " + button_press , { y: 9, color: color`H` }); playTune(endd, Infinity); }
if (endlvl == 1) { addText("You found ", { y: 4, color: color`4` }); addText("the hidden level!", { y: 5, color: color`4` }); addText("Time Taken: " + min + ":" + seconds , { y: 7, color: color`5` }); addText("Pressed: " + button_press , { y: 9, color: color`H` }); addText("Resets: " + reset_used , { y: 11, color: color`F` }); const playback = playTune(secnd, 1); }
else { addText("Winner!", { y: 3, color: color`3` }); addText("Time Taken: " + min + ":" + seconds , { y: 6, color: color`5` }); addText("Pressed: " + button_press , { y: 9, color: color`H` }); addText("Resets: " + reset_used , { y: 11, color: color`F` }); const playback = playTune(endd, 1); }
}
}
});

0 comments on commit 1c83b96

Please sign in to comment.