Fix
This commit is contained in:
parent
7f8f10aa56
commit
71c214561a
Binary file not shown.
Before Width: | Height: | Size: 153 KiB After Width: | Height: | Size: 196 KiB |
16
js/snake.js
16
js/snake.js
@ -9,7 +9,7 @@ $(document).ready(function () {
|
|||||||
var snake;
|
var snake;
|
||||||
var d = "RIGHT";
|
var d = "RIGHT";
|
||||||
var gameloop;
|
var gameloop;
|
||||||
|
|
||||||
function start(gameloop){
|
function start(gameloop){
|
||||||
gameloop = setInterval(update, 100);
|
gameloop = setInterval(update, 100);
|
||||||
return gameloop
|
return gameloop
|
||||||
@ -53,8 +53,9 @@ $(document).ready(function () {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
form = JSON.stringify(form);
|
form = JSON.stringify(form);
|
||||||
localStorage.setItem("new_question",form);
|
localStorage.setItem("new_question",form);
|
||||||
|
$(this).closest('form').find("input[type=text]").val("");
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#add_question').click(function(){
|
$('#add_question').click(function(){
|
||||||
var isHidden = localStorage.getItem('isHidden');
|
var isHidden = localStorage.getItem('isHidden');
|
||||||
if(isHidden === null){
|
if(isHidden === null){
|
||||||
@ -68,7 +69,7 @@ $(document).ready(function () {
|
|||||||
localStorage.setItem('isHidden', 'true');
|
localStorage.setItem('isHidden', 'true');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
$('#session').text(getSessionScore())
|
$('#session').text(getSessionScore())
|
||||||
|
|
||||||
@ -98,13 +99,16 @@ $(document).ready(function () {
|
|||||||
if ($('#yes').is(':checked')) {
|
if ($('#yes').is(':checked')) {
|
||||||
$('#correct').fadeIn('slow');
|
$('#correct').fadeIn('slow');
|
||||||
$('#session').text(getSessionScore());
|
$('#session').text(getSessionScore());
|
||||||
$('#no').attr('disabled','disabled');
|
$('#no').attr('disabled','disabled').delay(1000);;
|
||||||
|
$('#yes').prop('checked', false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$('#no').click(function(){
|
$('#no').click(function(){
|
||||||
if($('#no').is(':checked')){
|
if($('#no').is(':checked')){
|
||||||
$('#incorrect').fadeIn('slow');
|
$('#incorrect').fadeIn('slow');
|
||||||
$('#yes').attr('disabled','disabled');
|
$('#yes').attr('disabled','disabled').delay(1000);;
|
||||||
|
$('#no').prop('checked', false);
|
||||||
|
localStorage.removeItem('session_score');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -193,7 +197,7 @@ $(document).ready(function () {
|
|||||||
} else if (key == "40") {
|
} else if (key == "40") {
|
||||||
snake.y += 1;
|
snake.y += 1;
|
||||||
d = "DOWN";
|
d = "DOWN";
|
||||||
} else if(key == "32"){
|
} else if(key == "33"){
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
snake.html
12
snake.html
@ -11,29 +11,29 @@
|
|||||||
<button id="add_question">AddQuestion</button>
|
<button id="add_question">AddQuestion</button>
|
||||||
<form id='popup_question'>
|
<form id='popup_question'>
|
||||||
<input type="text" name="question" placeholder="Podaj pytanie"><br>
|
<input type="text" name="question" placeholder="Podaj pytanie"><br>
|
||||||
<input type="text" name="answer1"placeholder="Podaj odpowiedz 1"><br>
|
<input type="text" name="answer1" placeholder="Podaj odpowiedz 1"><br>
|
||||||
<input type="text" name="answer2"placeholder="Podaj odpowiedz 2"><br>
|
<input type="text" name="answer2" placeholder="Podaj odpowiedz 2"><br>
|
||||||
<input type="text" name="answer3"placeholder="Podaj odpowiedz 3"><br>
|
<input type="text" name="answer3" placeholder="Podaj odpowiedz 3"><br>
|
||||||
<input type="text" name="answer4" placeholder="Podaj odpowiedz 4"><br>
|
<input type="text" name="answer4" placeholder="Podaj odpowiedz 4"><br>
|
||||||
<button id="send_question" type="submit">Wyslij</button>
|
<button id="send_question" type="submit">Wyslij</button>
|
||||||
</form>
|
</form>
|
||||||
<div id="popup">
|
<div id="popup">
|
||||||
Odpowiedz na pytanie!
|
Odpowiedz na pytanie!
|
||||||
<br>
|
<br>
|
||||||
<p>Czy lubisz jabłka?</p>
|
<p>Czy lubisz jablka?</p>
|
||||||
<input id="yes" type="radio" value="yes" name="yes_no">Tak<br>
|
<input id="yes" type="radio" value="yes" name="yes_no">Tak<br>
|
||||||
<input id="no" type="radio" value="no" name="yes_no">No<br>
|
<input id="no" type="radio" value="no" name="yes_no">No<br>
|
||||||
<a type="submit" value="submit">
|
<a type="submit" value="submit">
|
||||||
<span id="correct">To jest dobra odpowiedz,<br> mozesz grac dalej!</span><br>
|
<span id="correct">To jest dobra odpowiedz,<br> mozesz grac dalej!</span><br>
|
||||||
<!-- <button id="continue_game">Ruszaj dalej!</button> -->
|
<!-- <button id="continue_game">Ruszaj dalej!</button> -->
|
||||||
<div id="incorrect">To jest zla odpowiedz!Przegraleś!<br>
|
<div id="incorrect">To jest zla odpowiedz!Przegrales!<br>
|
||||||
Twoj wynik to: <span id="final"></span>
|
Twoj wynik to: <span id="final"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<a id="#restart" onClick="window.location.reload()" href="#">Click To Play Again</a>
|
<a id="#restart" onClick="window.location.reload()" href="#">Click To Play Again</a>
|
||||||
</div>
|
</div>
|
||||||
<canvas id="myCanvas" width="600" height="450">
|
<canvas id="myCanvas" width="600" height="450">
|
||||||
Your browser does not support the canvas feature
|
Your browser does not support the canvas feature
|
||||||
</canvas>
|
</canvas>
|
||||||
<div id="score">
|
<div id="score">
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
- obsluga bledu, gdzie nie ma gry,
|
- obsluga bledu, gdzie nie ma gry,
|
||||||
- formularz do wprowadzania pytan,
|
- zjadam muche mam pytanie, jak odpowiem to dostane punkt, jak wpadne w sciane strata punktu,(poprawic mechanike snejka,
|
||||||
- testy do gier dodac,
|
- wyglad(głowna i strona snejka),
|
||||||
- snake - moze kiedy zje to wydluza sie jezeli zostanie podana poprawna odpowiwiedz
|
- pacman(jak zjada to jest pytanie),
|
||||||
- 17.01(ostatnie zajecia ktore pokazuja juz finalny produkt)
|
- baza danych juz nie,
|
||||||
|
Loading…
Reference in New Issue
Block a user