-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f9cf34
commit 5ad4fb2
Showing
1,276 changed files
with
271 additions
and
159,179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
|
||
<link rel="stylesheet" type="text/css" href="../public/game.css"> | ||
<title>Game</title> | ||
|
||
</head> | ||
<body> | ||
<div class="nav-bar"> | ||
<ul class="horizontal"> | ||
<li><a class="active">Welcome {{ user.getUserName() }}</a></li> | ||
|
||
<li><a href="{{ url }}/chat">Chat</a></li> | ||
|
||
|
||
|
||
<li class="rightli" style="float:right"><a href="{{ url }}/deconnect">Logout</a></li> | ||
</ul> | ||
</div> | ||
<div id="cont"> | ||
<p> Welcome to your favorite games party <strong>Battleship </strong> </p> | ||
|
||
<p style="font-family: Times New Roman;">Find the 17 batteships, your score will be displayed at the end of the game, have fun</p> | ||
|
||
<div id="grilleDeJeux"> | ||
</div> | ||
<p id="score" > </p> | ||
</div> | ||
|
||
|
||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> | ||
<script type="text/javascript" src="../public/game.js"></script> | ||
|
||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,7 @@ | |
|
||
<script> | ||
function infos(){ | ||
alert('Hi this site is realized by a group of students of Supinfo Paris, if you encounter a problem you can contact us at any time on [email protected]'); | ||
alert('Hi this site is realized by a group of students of Supinfo Paris, if you encounter a problem you can contact us at any time on [email protected], The two students Chakib and Samy deal with the development part of the application, jeremy takes care of the management and Sarah keeps the business'); | ||
} | ||
</script> | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
@CHARSET "UTF-8"; | ||
#cont { | ||
|
||
margin: 2% ; | ||
width: 70%; | ||
} | ||
|
||
ul.horizontal { | ||
list-style-type: none; | ||
margin: 0; | ||
padding: 0; | ||
overflow: hidden; | ||
background-color: #3498DB; | ||
border: 3px solid; | ||
} | ||
|
||
ul.horizontal li { | ||
float: left; | ||
} | ||
|
||
ul.horizontal li a { | ||
display: inline-block; | ||
color: white; | ||
text-align: center; | ||
padding: 14px 16px; | ||
text-decoration: none; | ||
} | ||
|
||
ul.horizontal li a:hover:not(.active) { | ||
background-color: #000; | ||
} | ||
|
||
ul.horizontal li a.active { | ||
background-color:#4CAF50; | ||
} | ||
|
||
#grilleDeJeux { | ||
position:relative; | ||
margin-left: auto; | ||
margin-right: auto; | ||
width:15%; | ||
|
||
} | ||
|
||
#grilleDeJeux p { | ||
position:absolute; | ||
width:40px; | ||
height:40px; | ||
-webkit-box-sizing: border-box; | ||
-moz-box-sizing: border-box; | ||
box-sizing: border-box; | ||
background: #f6f8f9; | ||
border: 1px solid #ddd; | ||
|
||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
/** | ||
* Created by macbookpro on 26/06/2017. | ||
*/ | ||
|
||
/** | ||
* | ||
*/ | ||
|
||
$(document).ready(function(){ | ||
|
||
var score = 0; | ||
var conteneur = document.getElementById("grilleDeJeux"); | ||
|
||
//construction de la grille | ||
for (i = 0; i < 10; i++) { | ||
for (j = 0; j < 10; j++) { | ||
var carre = document.createElement("p"); | ||
conteneur.appendChild(carre); | ||
carre.id = 's' + j + i; | ||
|
||
carre.style.top = j * 40 + 'px'; | ||
carre.style.left = i * 40 + 'px'; | ||
} | ||
} | ||
|
||
var test1 = 1; | ||
var test2 = 1; | ||
var test3 = 1; | ||
var test4 = 1; | ||
var test5 = 1; | ||
|
||
var jeux = [ | ||
[a(),0,a(),a(),0,a(),a(),a(),0,a()], | ||
[a(),0,a(),a(),a(),0,a(),a(),a(),0], | ||
[b(),0,b(),b(),0,b(),0,b(),b(),b()], | ||
[b(),b(),0,b(),b(),b(),0,b(),0,b()], | ||
[c(),c(),0,c(),c(),c(),0,c(),0,c()], | ||
[c(),c(),0,c(),c(),c(),0,c(),c(),0], | ||
[0,d(),0,d(),d(),0,d(),d(),d(),d()], | ||
[d(),d(),d(),0,d(),0,d(),0,d(),d()], | ||
[e(),0,0,e(),e(),0,e(),e(),e(),e()], | ||
[e(),e(),e(),e(),0,e(),0,e(),0,e()] | ||
]; | ||
//la logique des cellule | ||
function a(){ | ||
var a = [1, 0][Math.floor(Math.random() * 2)]; | ||
if(test1 < 4){ | ||
if(a == 1){ | ||
test1++ ; | ||
return a; | ||
}else { | ||
return a; | ||
} | ||
}else { | ||
return 0; | ||
} | ||
} | ||
|
||
function b(){ | ||
var a = [1, 0][Math.floor(Math.random() * 2)]; | ||
if(test2 < 5){ | ||
if(a == 1){ | ||
test2++ ; | ||
return a; | ||
}else { | ||
return a; | ||
} | ||
}else { | ||
return 0; | ||
} | ||
} | ||
|
||
function c(){ | ||
var a = [1, 0][Math.floor(Math.random() * 2)]; | ||
if(test3 < 4){ | ||
if(a == 1){ | ||
test3++ ; | ||
return a; | ||
}else { | ||
return a; | ||
} | ||
}else { | ||
return 0; | ||
} | ||
} | ||
|
||
function d(){ | ||
var a = [1, 0][Math.floor(Math.random() * 2)]; | ||
if(test4 < 4){ | ||
if(a == 1){ | ||
test4++ ; | ||
return a; | ||
}else { | ||
return a; | ||
} | ||
}else { | ||
return 0; | ||
} | ||
} | ||
|
||
function e(){ | ||
var a = [1, 0][Math.floor(Math.random() * 2)]; | ||
if(test5 < 5){ | ||
if(a == 1){ | ||
test5++ ; | ||
return a; | ||
}else { | ||
return a; | ||
} | ||
}else { | ||
return 0; | ||
} | ||
} | ||
|
||
var nombrePrises = 0; | ||
|
||
//evenement | ||
conteneur.addEventListener("click", logic, false); | ||
|
||
//la logique du jeux | ||
function logic(e) { | ||
|
||
if (e.target !== e.currentTarget) { | ||
|
||
var ligne = e.target.id.substring(1,2); | ||
var colonne = e.target.id.substring(2,3); | ||
|
||
if (jeux[ligne][colonne] == 0) { | ||
e.target.style.background = '#bbb'; | ||
|
||
jeux[ligne][colonne] = 3; | ||
score++; | ||
|
||
} else if (jeux[ligne][colonne] == 1) { | ||
e.target.style.background = 'red'; | ||
|
||
jeux[ligne][colonne] = 2; | ||
score++; | ||
|
||
nombrePrises++; | ||
//fin de la partie | ||
if (nombrePrises == 17) { | ||
alert("All enemy battleships have been defeated! You win!"); | ||
alert('your score is '+score+' click'); | ||
$('#score').css('text-align', 'left').css('font-size', '150%').css('color', 'green'); | ||
$('#score').text('your win after '+score+' clicks'); | ||
} | ||
|
||
// en cas de click une deuxieme fois dans une cellule selectionnée | ||
} else if (jeux[ligne][colonne] > 1) { | ||
alert("Stop wasting your torpedos! You already fired at this location."); | ||
} | ||
} | ||
e.stopPropagation(); | ||
} | ||
|
||
}); |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,7 +58,7 @@ $(document).ready(function() { | |
}); | ||
|
||
$('#infos').on('click', function () { | ||
alert('Hi this site is realized by a group of students of Supinfo Paris, if you encounter a problem you can contact us at any time on [email protected]'); | ||
alert('Hi this site is realized by a group of students of Supinfo Paris, if you encounter a problem you can contact us at any time on [email protected], The two students Chakib and Samy deal with the development part of the application, jeremy takes care of the management and Sarah keeps the business'); | ||
}) | ||
|
||
|
||
|
Binary file not shown.
Oops, something went wrong.