Il est tout comme Mite' !

This commit is contained in:
alexandre-pereira 2015-03-14 17:48:57 +01:00
parent 33ac86a89b
commit 4135ae7317
6 changed files with 107 additions and 41 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

1
SRC/public/js/classList.min.js vendored Normal file
View File

@ -0,0 +1 @@
"document"in self&&("classList"in document.createElement("_")?!function(){"use strict";var a=document.createElement("_");if(a.classList.add("c1","c2"),!a.classList.contains("c2")){var b=function(a){var b=DOMTokenList.prototype[a];DOMTokenList.prototype[a]=function(a){var c,d=arguments.length;for(c=0;d>c;c++)a=arguments[c],b.call(this,a)}};b("add"),b("remove")}if(a.classList.toggle("c3",!1),a.classList.contains("c3")){var c=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(a,b){return 1 in arguments&&!this.contains(a)==!b?b:c.call(this,a)}}a=null}():!function(a){"use strict";if("Element"in a){var b="classList",c="prototype",d=a.Element[c],e=Object,f=String[c].trim||function(){return this.replace(/^\s+|\s+$/g,"")},g=Array[c].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1},h=function(a,b){this.name=a,this.code=DOMException[a],this.message=b},i=function(a,b){if(""===b)throw new h("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(b))throw new h("INVALID_CHARACTER_ERR","String contains an invalid character");return g.call(a,b)},j=function(a){for(var b=f.call(a.getAttribute("class")||""),c=b?b.split(/\s+/):[],d=0,e=c.length;e>d;d++)this.push(c[d]);this._updateClassName=function(){a.setAttribute("class",this.toString())}},k=j[c]=[],l=function(){return new j(this)};if(h[c]=Error[c],k.item=function(a){return this[a]||null},k.contains=function(a){return a+="",-1!==i(this,a)},k.add=function(){var a,b=arguments,c=0,d=b.length,e=!1;do a=b[c]+"",-1===i(this,a)&&(this.push(a),e=!0);while(++c<d);e&&this._updateClassName()},k.remove=function(){var a,b,c=arguments,d=0,e=c.length,f=!1;do for(a=c[d]+"",b=i(this,a);-1!==b;)this.splice(b,1),f=!0,b=i(this,a);while(++d<e);f&&this._updateClassName()},k.toggle=function(a,b){a+="";var c=this.contains(a),d=c?b!==!0&&"remove":b!==!1&&"add";return d&&this[d](a),b===!0||b===!1?b:!c},k.toString=function(){return this.join(" ")},e.defineProperty){var m={get:l,enumerable:!0,configurable:!0};try{e.defineProperty(d,b,m)}catch(n){-2146823252===n.number&&(m.enumerable=!1,e.defineProperty(d,b,m))}}else e[c].__defineGetter__&&d.__defineGetter__(b,l)}}(self));

View File

@ -7,16 +7,6 @@
@section('content')
<div class="container">
<br>
<center><h1>Mémory</h1></center>
<br><br>
<!-- script jeu memory -->
<!-- js -->
<script src="/js/classList.min.js"></script>
<script src="/js/memory.js"></script>
<!-- <center><img src="http://i.ytimg.com/vi/xiIO1zUXNVI/maxresdefault.jpg" width="60%"></center> -->
@ -38,4 +28,82 @@
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="/js/classList.min.js"></script>
<script src="/js/memory.js"></script>
<script>
(function(){
var myMem = new Memory({
wrapperID : "my-memory-game",
cards : [
{
id : 1,
img: "/pictures/default/monsters-01.png"
},
{
id : 2,
img: "/pictures/default/monsters-02.png"
},
{
id : 3,
img: "/pictures/default/monsters-03.png"
},
{
id : 4,
img: "/pictures/default/monsters-04.png"
},
{
id : 5,
img: "/pictures/default/monsters-05.png"
},
{
id : 6,
img: "/pictures/default/monsters-06.png"
},
{
id : 7,
img: "/pictures/default/monsters-07.png"
},
{
id : 8,
img: "/pictures/default/monsters-08.png"
},
{
id : 9,
img: "/pictures/default/monsters-09.png"
},
{
id : 10,
img: "/pictures/default/monsters-10.png"
},
{
id : 11,
img: "/pictures/default/monsters-11.png"
},
{
id : 12,
img: "/pictures/default/monsters-12.png"
},
{
id : 13,
img: "/pictures/default/monsters-13.png"
},
{
id : 14,
img: "/pictures/default/monsters-14.png"
},
{
id : 15,
img: "/pictures/default/monsters-15.png"
},
{
id : 16,
img: "/pictures/default/monsters-16.png"
}
],
onGameStart : function() { return false; },
onGameEnd : function() { return false; }
});
})();
</script>
@endsection

View File

@ -10,17 +10,17 @@
</div>
<br>
<button onclick="location.href='{{ URL::to('memo/jouer') }}'"><span style="color:gold;">
<button onclick="location.href='{{ URL::to('memo/jouer/1') }}'"><span style="color:gold;">
<span class="icon-star-full"></span>
</span><span class="icon-star-full"></span>
<span class="icon-star-full"></span></button><br>
<button onclick="location.href='{{ URL::to('memo/jouer') }}'"><span style="color:gold;">
<button onclick="location.href='{{ URL::to('memo/jouer/2') }}'"><span style="color:gold;">
<span class="icon-star-full"></span>
<span class="icon-star-full"></span>
</span>
<span class="icon-star-full"></span></button><br>
<button onclick="location.href='{{ URL::to('memo/jouer') }}'"><span style="color:gold;">
<button onclick="location.href='{{ URL::to('memo/jouer/3') }}'"><span style="color:gold;">
<span class="icon-star-full"></span>
<span class="icon-star-full"></span><span class="icon-star-full"></span>
</span>

View File

@ -149,23 +149,33 @@
var texteADire = (temps <= 1) ? "Bravo, tu as mis moins d'une minute." :
"Bravo, tu as mis "+temps+" minutes. ";;
responsiveVoice.speak(texteADire, "French Female");
leftEmitter = game.add.emitter(50, 50);
leftEmitter.bounce.setTo(0.5, 0.5);
leftEmitter.setXSpeed(100, 200);
leftEmitter.setYSpeed(-50, 50);
leftEmitter.makeParticles('balls', 0, 10, 1, true);
pieces.forEach(function(item){item.input.draggable = false;});
if(nbToPlay == currentPlayed)
{
leftEmitter = game.add.emitter(50, 50);
leftEmitter.bounce.setTo(0.5, 0.5);
leftEmitter.setXSpeed(100, 200);
leftEmitter.setYSpeed(-50, 50);
leftEmitter.makeParticles('balls', 0, 10, 1, true);
rightEmitter = game.add.emitter(game.world.width - 50, 50);
rightEmitter.bounce.setTo(0.5, 0.5);
rightEmitter.setXSpeed(-100, -200);
rightEmitter.setYSpeed(-50, 50);
rightEmitter.makeParticles('balls', 1, 10, 1, true);
rightEmitter = game.add.emitter(game.world.width - 50, 50);
rightEmitter.bounce.setTo(0.5, 0.5);
rightEmitter.setXSpeed(-100, -200);
rightEmitter.setYSpeed(-50, 50);
rightEmitter.makeParticles('balls', 1, 10, 1, true);
// explode, lifespan, frequency, quantity
leftEmitter.start(false, 10000, 20);
rightEmitter.start(false, 10000, 20);
if(nbToPlay == currentPlayed) setTimeout(function(){ location.href = "{{URL::to('puzzle')}}"; }, 5000);
else nextPuzzle();
// explode, lifespan, frequency, quantity
leftEmitter.start(false, 10000, 20);
rightEmitter.start(false, 10000, 20);
setTimeout(function(){
location.href = "{{URL::to('puzzle')}}";
}, 5000);
}
else {
setTimeout(function(){
nextPuzzle();
}, 5000);
}
}
}

View File

@ -2,7 +2,6 @@
@section('content')
<div class="trophees"></div>
<div class="abso referents">
<div class="referent game"
onclick='location.href = "{{ URL::to('puzzle') }}";'
@ -27,16 +26,4 @@
@section('page-css')
<link href="{{ URL::to('css/fonts/style.css') }}" rel="stylesheet" type="text/css"/>
@endsection
@section('page-scripts')
<script src="{{ URL::to('js/phaser.min.js') }}"></script>
<script type="text/javascript">
game = new Phaser.Game(222, 222, Phaser.CANVAS, '', { preload: preload, create: create }, true);
function preload() {
}function create() {
}
</script>
@endsection