Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: fernetjs/LuridCabinet
base: 0264e61718
...
head fork: fernetjs/LuridCabinet
compare: 920a128ab8
  • 3 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 54 additions and 5 deletions.
  1. +18 −0 css/style.css
  2. +36 −5 js/game.js
18 css/style.css
View
@@ -0,0 +1,18 @@
+:fullscreen {
+ width: 100% !important;
+ height: 100% !important;
+}
+:-webkit-full-screen {
+ width: 100% !important;
+ height: 100% !important;
+ display: block;
+}
+-moz-full-screen {
+ width: 100% !important;
+ height: 100% !important;
+}
+
+canvas {
+ max-width: 800px;
+ width: 100%;
+}
41 js/game.js
View
@@ -55,8 +55,9 @@
height: 30
},
text: {
- font: '50px saint',
- x: 20
+ font: '20px saint',
+ x: 20,
+ fontColor: 'white'
},
textCmd: {
font: '20px saint-serif',
@@ -65,12 +66,29 @@
}
});
- Pac.init('canvas').addScene(school);
+ var intro = new Pac.Scene('intro', 'a sweet introduction', null, {
+ drawHook: function(){
+ var ctx = Pac.getContext();
+ ctx.fillStyle = "rgb(0,0,0)";
+ ctx.fillRect (0, 0, attrs.width(), attrs.height());
+ }
+ });
+
+
+ Pac.init('canvas').addScene(intro).addScene(school);
+ //Pac.toggleCommandBar();
+
+ Pac.changeToScene('intro');
+ //txtIntro = new Pac.TextManager({fontColor: 'white'});
+ txtIntro = Pac.getMainTextManager();
- Pac.changeToScene('schoolFront');
+ //Pac.changeToScene('schoolFront');
Pac.repository.on('complete', function(){
- Pac.start();
+ Pac.start();
+ txtIntro.writeMany(['Un dia común', 'En un país extraño', 'el enano puto estaba en la escuela'], 70)
+ .setOnClear(function(){Pac.changeToScene('schoolFront');});
+
}).on('report', function(prg){
}).on('error', function(err){
@@ -78,3 +96,16 @@
}).load();
})();
+
+// FULLSCREEN
+document.documentElement.addEventListener('keypress', function(ev){
+ var keycd = ev.which || ev.keyCode;
+ if(ev.ctrlKey && [10, 13].indexOf(keycd) !== -1 ){
+ var canvas = document.getElementById('canvas'),
+     requestFullscreen = canvas.requestFullscreen || canvas.mozRequestFullScreen || canvas.webkitRequestFullScreen;
+ if(requestFullscreen){
+     requestFullscreen.call(canvas);
+ }
+ }
+
+}, false);

No commit comments for this range

Something went wrong with that request. Please try again.