Permalink
Browse files

presentation

  • Loading branch information...
Owner Owner
Owner authored and Owner committed Jan 11, 2019
1 parent 7848b94 commit a2a1a5c19421eebe2746bc12fc85201914992ae4
Showing with 297 additions and 33 deletions.
  1. +10 −33 js/app.js
  2. +287 −0 js/main.js
View
@@ -92,9 +92,6 @@ class HamburgerKing {
$bun.on('click',() => {
if(this.requests[0] === 'bun'){
this.confirm[0] = 'bun';
// console.log(this.confirm[0]);
//console.log('The Order = ', this.requests);
//console.log('The Player Burger = ', this.confirm);
$('.order-wrapper').append('<img class="on-plate bunB" src="./css/BottomBun.png">')
$('.order-wrapper').append('<img class="on-plate bunU" src="./css/Bun.png">')
$('.bunB').velocity("callout.bounce");
@@ -106,11 +103,8 @@ class HamburgerKing {
});
$lettuce.on('click',()=>{
// console.log(this.confirm[1]);
if(this.requests[1] === 'lettuce'){
this.confirm[1] = 'lettuce';
//console.log('The Order = ', this.requests);
//console.log('The Player Burger = ', this.confirm);
$('.order-wrapper').append('<img class="on-plate lett" src="./css/Lettus.png">')
$('.lett').velocity("callout.bounce");
}else{
@@ -119,12 +113,8 @@ class HamburgerKing {
}
});
$patty.on('click',()=>{
// console.log(this.confirm[2]);
if(this.requests[2] === 'patty'){
this.confirm[2] = 'patty'
// console.log('The Order = ', this.requests);
// console.log('The Player Burger = ', this.confirm);
this.confirm[2] = 'patty';
$('.order-wrapper').append('<img class="on-plate patt" src="./css/Patty.png">')
$('.patt').velocity("callout.bounce")
}else{
@@ -133,12 +123,8 @@ class HamburgerKing {
}
});
$tomato.on('click',()=>{
// console.log(this.confirm[3]);
if(this.requests[3] === 'tomato'){
this.confirm[3] = 'tomato';
// console.log('The Order = ', this.requests);
// console.log('The Player Burger = ', this.confirm);
$('.order-wrapper').append('<img class="on-plate toma" src="./css/Tomato.png">')
$('.toma').velocity("callout.bounce")
}else{
@@ -148,12 +134,8 @@ class HamburgerKing {
});
$cheese.on('click',()=>{
// console.log(this.confirm[4]);
if(this.requests[4] === 'cheese'){
this.confirm[4] = 'cheese';
// console.log('The Order = ', this.requests);
// console.log('The Player Burger = ', this.confirm);
$('.order-wrapper').append('<img class="on-plate chee" src="./css/Cheese.png">')
$('.chee').velocity("callout.bounce")
}else{
@@ -162,12 +144,8 @@ class HamburgerKing {
}
});
$mayo.on('click',()=>{
// console.log(this.confirm[5]);
if(this.requests[5] === 'mayo'){
this.confirm[5] = 'mayo';
// console.log('The Order = ', this.requests);
// console.log('The Player Burger = ', this.confirm);
$('.order-wrapper').append('<img class="on-plate mayo" src="./css/Mayo.png">')
$('.mayo').velocity("callout.bounce")
}else{
@@ -184,20 +162,25 @@ class HamburgerKing {
} else {
hamburger.orderArray.push(true);
}
//hamburger.confirm = ['no bun', 'no lettuce', 'no patty', 'no tomato', 'no cheese', 'no mayo']
}
console.log(hamburger.requests)
console.log(hamburger.confirm)
console.log(hamburger.orderArray)
if (hamburger.orderArray.includes(false)) {
hamburger.orderArray =[];
hamburger.confirm = ['no bun', 'no lettuce', 'no patty', 'no tomato', 'no cheese', 'no mayo']
return alert('You lost...!');
}else{
this.score += 1;
this.customers += 1;
hamburger.orderArray =[];
hamburger.confirm = ['no bun', 'no lettuce', 'no patty', 'no tomato', 'no cheese', 'no mayo']
$('#left').text(`Burger : ${this.score}`);
//alert('Order is correct...!')
this.getRequest()
// document.querySelector('.bunB').remove()
$('.order-wrapper').empty().append(`<img id="plate" src="./css/tray.png">`)
}
};
if(this.score === this.orders){
this.level += 1;
@@ -208,17 +191,13 @@ class HamburgerKing {
};
reset(){
//console.log(hamburger.orderArray)
$('#request').hide();
$('#timer').hide();
$('#profile h3').hide();
$('.info').hide();
//hamburger.orderArray=[];<- try to clear.. but it doesn't work
$('#messageBox').append(`<div id="newMess">Try again?</div>`);
$('#messageBox').append(`<button id="againBtn">Again</button>`);
$('#againBtn').on('click', () =>{
// $('#messageBox').empty();fail -> it shouldn't be empty..
// $('#profile').empty();fail -> it shouldn't be empty..
$('.on-plate').remove();
$('#newMess').remove();
$('#againBtn').remove();
@@ -230,10 +209,8 @@ class HamburgerKing {
}
levelTwo(){
//console.log(hamburger.orderArray)
$('#request').hide();
$('#timer').hide();
//hamburger.orderArray=[]; <- try to clear.. but it doesn't work
$('#messageBox').append(`<div id="levelUpMess">congrats!</div>`);
$('#messageBox').append(`<button id="next">next</button>`);
$('#next').on('click', () =>{
@@ -272,7 +249,7 @@ class HamburgerKing {
//score => how many player made so far..
//orders => how many player should make each level
//customers => start from 1
let hamburger = new HamburgerKing(name, 0, 30, 1, 1, 1,[null, null, null, null, null, null],['no bun', 'no lettuce', 'no patty', 'no tomato', 'no cheese', 'no mayo'],[]);
let hamburger = new HamburgerKing(name, 0, 30, 1, 1, 2,[null, null, null, null, null, null],['no bun', 'no lettuce', 'no patty', 'no tomato', 'no cheese', 'no mayo'],[]);
//variable
const $startBtn = $('#startBtn');
Oops, something went wrong.

0 comments on commit a2a1a5c

Please sign in to comment.