diff --git a/star.js/css/star.css b/star.js/css/star.css
new file mode 100644
index 0000000..166854c
--- /dev/null
+++ b/star.js/css/star.css
@@ -0,0 +1,11 @@
+.gstar{float:left;width:100%}
+.gstar #blackboard{width:320px;height:180px;background:#333;float:left}
+.gstar #blackboard .starcell{width:20px;height:20px;display:block;float:left;text-align:center}
+.gstar #blackboard .wall{background-image:url(../themes/HP48/tex_wall.png);color:#000}
+.gstar #blackboard .ball{background-image:url(../themes/HP48/tex_ball.png);color:#99f}
+.gstar #blackboard .cube{background-image:url(../themes/HP48/tex_cube.png);color:red}
+.gstar #blackboard .ball_selected{background-image:url(../themes/HP48/tex_ball_selected.png);color:#99f}
+.gstar #blackboard .cube_selected{background-image:url(../themes/HP48/tex_cube_selected.png);color:red}
+.gstar #blackboard .gift{background-image:url(../themes/HP48/tex_gift.png);color:yellow}
+.gstar #blackboard .void{background-image:url(../themes/HP48/tex_empty.png);}
+.gstar aside{float:left;height:140px;width:120px;padding:20px;background:#ddd}
diff --git a/star.js/index.html b/star.js/index.html
index 82cbae1..9dbd02b 100644
--- a/star.js/index.html
+++ b/star.js/index.html
@@ -17,32 +17,19 @@
+
@@ -60,7 +47,7 @@
diff --git a/star.js/js/star.js b/star.js/js/star.js
index 078e4f4..09ca70a 100644
--- a/star.js/js/star.js
+++ b/star.js/js/star.js
@@ -26,7 +26,7 @@ var options = {
};
var state = {
moving : cell.BALL,
- distance_travelled : 0,
+ distance_travelled : 0,
level : 0,
board : ""
};
@@ -95,7 +95,7 @@ function won_or_not( state ) {
return count_gifts( state ) === 0;
}
-function format_level( state ) {
+function format_level( state, text ) {
function Replacer( conversionObject ) {
var regexpStr = '';
@@ -118,11 +118,24 @@ function format_level( state ) {
'H': 'H',
'@': '@'
};
- substitutions[ state.moving ] = substitutions[ state.moving ].replace( '">', ' selected">' );
+ substitutions[ state.moving ] = substitutions[ state.moving ].replace( '">', '_selected">' );
+ if ( text == false ) {
+ for ( var c in substitutions ) {
+ substitutions[ c ] = substitutions[ c ].replace( />., '><' );
+ }
+ }
var myReplacer = Replacer( substitutions );
return myReplacer( state.board );
}
+function format_infos( state ) {
+ var infos = "Star5
";
+ infos += "Level " + (state.level+1) + " of " + levels.length + "
";
+ infos += count_gifts( state ) + " gifts left
";
+ infos += state.distance_travelled + " meters travelled";
+ return infos;
+}
+
function load_level( levelset, nb ) {
state.level = nb;
state.board = levelset[ state.level ];
@@ -132,7 +145,8 @@ function load_level( levelset, nb ) {
}
function display_level( state, elt ) {
- $( elt ).html( format_level( state ) );
+ var starhtml = '' + format_level( state, false ) + '
';
+ $( elt ).html( starhtml );
}
diff --git a/star.js/themes/HP48/tex_ball.png b/star.js/themes/HP48/tex_ball.png
new file mode 100644
index 0000000..b960e4f
Binary files /dev/null and b/star.js/themes/HP48/tex_ball.png differ
diff --git a/star.js/themes/HP48/tex_ball_selected.png b/star.js/themes/HP48/tex_ball_selected.png
new file mode 100644
index 0000000..c3ad7df
Binary files /dev/null and b/star.js/themes/HP48/tex_ball_selected.png differ
diff --git a/star.js/themes/HP48/tex_cube.png b/star.js/themes/HP48/tex_cube.png
new file mode 100644
index 0000000..74914f4
Binary files /dev/null and b/star.js/themes/HP48/tex_cube.png differ
diff --git a/star.js/themes/HP48/tex_cube_selected.png b/star.js/themes/HP48/tex_cube_selected.png
new file mode 100644
index 0000000..9f04354
Binary files /dev/null and b/star.js/themes/HP48/tex_cube_selected.png differ
diff --git a/star.js/themes/HP48/tex_empty.png b/star.js/themes/HP48/tex_empty.png
new file mode 100644
index 0000000..c65f44b
Binary files /dev/null and b/star.js/themes/HP48/tex_empty.png differ
diff --git a/star.js/themes/HP48/tex_gift.png b/star.js/themes/HP48/tex_gift.png
new file mode 100644
index 0000000..7600b7e
Binary files /dev/null and b/star.js/themes/HP48/tex_gift.png differ
diff --git a/star.js/themes/HP48/tex_wall.png b/star.js/themes/HP48/tex_wall.png
new file mode 100644
index 0000000..91b4b49
Binary files /dev/null and b/star.js/themes/HP48/tex_wall.png differ
diff --git a/star.js/themes/cyco001/tex_ball.png b/star.js/themes/cyco001/tex_ball.png
new file mode 100644
index 0000000..2b5cd9a
Binary files /dev/null and b/star.js/themes/cyco001/tex_ball.png differ
diff --git a/star.js/themes/cyco001/tex_ball_selected.png b/star.js/themes/cyco001/tex_ball_selected.png
new file mode 100644
index 0000000..8ee623e
Binary files /dev/null and b/star.js/themes/cyco001/tex_ball_selected.png differ
diff --git a/star.js/themes/cyco001/tex_cube.png b/star.js/themes/cyco001/tex_cube.png
new file mode 100644
index 0000000..a5b38f0
Binary files /dev/null and b/star.js/themes/cyco001/tex_cube.png differ
diff --git a/star.js/themes/cyco001/tex_cube_selected.png b/star.js/themes/cyco001/tex_cube_selected.png
new file mode 100644
index 0000000..4a06c86
Binary files /dev/null and b/star.js/themes/cyco001/tex_cube_selected.png differ
diff --git a/star.js/themes/cyco001/tex_empty.png b/star.js/themes/cyco001/tex_empty.png
new file mode 100644
index 0000000..32c8b66
Binary files /dev/null and b/star.js/themes/cyco001/tex_empty.png differ
diff --git a/star.js/themes/cyco001/tex_gift.png b/star.js/themes/cyco001/tex_gift.png
new file mode 100644
index 0000000..12abefd
Binary files /dev/null and b/star.js/themes/cyco001/tex_gift.png differ
diff --git a/star.js/themes/cyco001/tex_wall.png b/star.js/themes/cyco001/tex_wall.png
new file mode 100644
index 0000000..8530623
Binary files /dev/null and b/star.js/themes/cyco001/tex_wall.png differ
diff --git a/star.js/themes/cyco002/tex_ball.png b/star.js/themes/cyco002/tex_ball.png
new file mode 100644
index 0000000..230ff4f
Binary files /dev/null and b/star.js/themes/cyco002/tex_ball.png differ
diff --git a/star.js/themes/cyco002/tex_ball_selected.png b/star.js/themes/cyco002/tex_ball_selected.png
new file mode 100644
index 0000000..db751e5
Binary files /dev/null and b/star.js/themes/cyco002/tex_ball_selected.png differ
diff --git a/star.js/themes/cyco002/tex_cube.png b/star.js/themes/cyco002/tex_cube.png
new file mode 100644
index 0000000..04fd45a
Binary files /dev/null and b/star.js/themes/cyco002/tex_cube.png differ
diff --git a/star.js/themes/cyco002/tex_cube_selected.png b/star.js/themes/cyco002/tex_cube_selected.png
new file mode 100644
index 0000000..d2ade42
Binary files /dev/null and b/star.js/themes/cyco002/tex_cube_selected.png differ
diff --git a/star.js/themes/cyco002/tex_empty.png b/star.js/themes/cyco002/tex_empty.png
new file mode 100644
index 0000000..d2585f9
Binary files /dev/null and b/star.js/themes/cyco002/tex_empty.png differ
diff --git a/star.js/themes/cyco002/tex_gift.png b/star.js/themes/cyco002/tex_gift.png
new file mode 100644
index 0000000..d9c2829
Binary files /dev/null and b/star.js/themes/cyco002/tex_gift.png differ
diff --git a/star.js/themes/cyco002/tex_wall.png b/star.js/themes/cyco002/tex_wall.png
new file mode 100644
index 0000000..aca40e3
Binary files /dev/null and b/star.js/themes/cyco002/tex_wall.png differ
diff --git a/star.js/themes/inversed/tex_ball.png b/star.js/themes/inversed/tex_ball.png
new file mode 100644
index 0000000..9b6b1b1
Binary files /dev/null and b/star.js/themes/inversed/tex_ball.png differ
diff --git a/star.js/themes/inversed/tex_ball_selected.png b/star.js/themes/inversed/tex_ball_selected.png
new file mode 100644
index 0000000..66f8fdf
Binary files /dev/null and b/star.js/themes/inversed/tex_ball_selected.png differ
diff --git a/star.js/themes/inversed/tex_cube.png b/star.js/themes/inversed/tex_cube.png
new file mode 100644
index 0000000..1efcc2e
Binary files /dev/null and b/star.js/themes/inversed/tex_cube.png differ
diff --git a/star.js/themes/inversed/tex_cube_selected.png b/star.js/themes/inversed/tex_cube_selected.png
new file mode 100644
index 0000000..85d684e
Binary files /dev/null and b/star.js/themes/inversed/tex_cube_selected.png differ
diff --git a/star.js/themes/inversed/tex_empty.png b/star.js/themes/inversed/tex_empty.png
new file mode 100644
index 0000000..15ec482
Binary files /dev/null and b/star.js/themes/inversed/tex_empty.png differ
diff --git a/star.js/themes/inversed/tex_gift.png b/star.js/themes/inversed/tex_gift.png
new file mode 100644
index 0000000..5f6131c
Binary files /dev/null and b/star.js/themes/inversed/tex_gift.png differ
diff --git a/star.js/themes/inversed/tex_wall.png b/star.js/themes/inversed/tex_wall.png
new file mode 100644
index 0000000..856e75e
Binary files /dev/null and b/star.js/themes/inversed/tex_wall.png differ