Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhitman <bryan@olenepal.org>2009-09-11 07:39:08 (GMT)
committer hitman <bryan@olenepal.org>2009-09-11 07:39:08 (GMT)
commit832f74505610cbb02bbfe0b9797ef2f4b13d7b9c (patch)
tree0833e43bb7c92b67c2d1cd0935b1dac8988f8e96
parent4d6f1cba9c115a88b0351192f87227b400486503 (diff)
cleaned out old files no longer used
-rwxr-xr-xdocs/index.html~61
-rwxr-xr-xexamples/adding_up_to_10/assets/generic/images/balloon.pngbin2292 -> 0 bytes
-rwxr-xr-xexamples/adding_up_to_10/assets/generic/images/bamboo_pattern.pngbin21869 -> 0 bytes
-rwxr-xr-xexamples/adding_up_to_10/assets/generic/images/banana.pngbin5277 -> 0 bytes
-rwxr-xr-xexamples/adding_up_to_10/assets/generic/images/bg.pngbin1258398 -> 0 bytes
-rwxr-xr-xexamples/adding_up_to_10/assets/generic/images/bg.png.bakbin1258398 -> 0 bytes
-rwxr-xr-xexamples/adding_up_to_10/assets/generic/images/fish.pngbin6988 -> 0 bytes
-rwxr-xr-xexamples/adding_up_to_10/assets/generic/images/flower.pngbin7428 -> 0 bytes
-rwxr-xr-xexamples/adding_up_to_10/assets/generic/images/happyChimp_200x209.pngbin27552 -> 0 bytes
-rwxr-xr-xexamples/adding_up_to_10/assets/generic/images/logo_w_name.pngbin3726 -> 0 bytes
-rwxr-xr-xexamples/adding_up_to_10/assets/generic/images/normalChimp_200x209.pngbin25474 -> 0 bytes
-rwxr-xr-xexamples/adding_up_to_10/assets/generic/images/old.pngbin6493 -> 0 bytes
-rwxr-xr-xexamples/adding_up_to_10/assets/generic/images/sadChimp_200x209.pngbin26127 -> 0 bytes
-rwxr-xr-xexamples/adding_up_to_10/assets/generic/images/solid_box.pngbin2005 -> 0 bytes
-rwxr-xr-xexamples/adding_up_to_10/assets/generic/images/striped_box.pngbin581 -> 0 bytes
-rwxr-xr-xexamples/adding_up_to_10/css/lesson1.css26
-rwxr-xr-xexamples/adding_up_to_10/css/lesson_multiple.css15
-rwxr-xr-xexamples/adding_up_to_10/css/mytest.css182
-rwxr-xr-xexamples/adding_up_to_10/js/lesson.js62
-rwxr-xr-xexamples/adding_up_to_10/js/lesson_multiple.js57
-rwxr-xr-xexamples/adding_up_to_10/resources.html4
21 files changed, 36 insertions, 371 deletions
diff --git a/docs/index.html~ b/docs/index.html~
deleted file mode 100755
index c6c86fb..0000000
--- a/docs/index.html~
+++ /dev/null
@@ -1,61 +0,0 @@
-<html lang="en">
-
-<head>
-<title>Karma - Adding Up to 10</title>
-<meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal">
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-
-<link rel="icon" type="image/ico" href="favicon.ico" />
-
-<link rel="stylesheet" type="text/css" href="css/karma.css" />
-<link rel="stylesheet" type="text/css" href="css/jquery.jgrowl.css" />
-<link rel="stylesheet" type="text/css" href="css/adding_up_to_10.css" />
-
-<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
-<script type="text/javascript" src="js/jquery.ui.all.js"></script>
-<script type="text/javascript" src="js/jquery.jgrowl_minimized.js"></script>
-<script type="text/javascript" src="js/jquery.localisation.min.js"></script>
-<script type="text/javascript" src="js/Gettext.js"></script>
-<script type="text/javascript" src="js/adding_up_to_10.js"></script>
-
-<link rel="gettext" type="application/x-po" href="po/en-US.po">
-<link rel="gettext" type="application/x-po" href="po/es-MX.po">
-<link rel="gettext" type="application/x-po" href="po/ne-NE.po">
-<link rel="gettext" type="application/x-po" href="po/he-IL.po">
-
-</head>
-
-<body>
-
- <noscript>
- Man, you need to enable JavaScript.
- </noscript>
-
-
- <div id="karma">
- <canvas id="canvas" width="1200" height="800"></canvas>
- <canvas id="canvasDrawing" width="1200" height="800"></canvas>
- </div>
-
-
- <div id="test">
- Change to another language:
- <form name=langSelector >
-
- <!-- <input type="radio" name="lang" value="def" checked> Default: English - United States <br/> -->
- <input type="radio" id="langid" name="lang" value="en-US" /> English - United States <br/>
- <input type="radio" id="langid" name="lang" value="es-MX" /> Spanish - Mexico <br/>
- <input type="radio" id="langid" name="lang" value="ne-NE" /> Nepalli - Nepal <br/>
- <input type="radio" id="langid" name="lang" value="he-IL" /> Hebrew - Israel <br/>
- </form>
- </div>
- <div id="debug">
- </div>
-
-</body>
-</html>
-
-
-
-
-
diff --git a/examples/adding_up_to_10/assets/generic/images/balloon.png b/examples/adding_up_to_10/assets/generic/images/balloon.png
deleted file mode 100755
index 6c17c31..0000000
--- a/examples/adding_up_to_10/assets/generic/images/balloon.png
+++ /dev/null
Binary files differ
diff --git a/examples/adding_up_to_10/assets/generic/images/bamboo_pattern.png b/examples/adding_up_to_10/assets/generic/images/bamboo_pattern.png
deleted file mode 100755
index 2ee8cfd..0000000
--- a/examples/adding_up_to_10/assets/generic/images/bamboo_pattern.png
+++ /dev/null
Binary files differ
diff --git a/examples/adding_up_to_10/assets/generic/images/banana.png b/examples/adding_up_to_10/assets/generic/images/banana.png
deleted file mode 100755
index 7600af1..0000000
--- a/examples/adding_up_to_10/assets/generic/images/banana.png
+++ /dev/null
Binary files differ
diff --git a/examples/adding_up_to_10/assets/generic/images/bg.png b/examples/adding_up_to_10/assets/generic/images/bg.png
deleted file mode 100755
index 84f6aaa..0000000
--- a/examples/adding_up_to_10/assets/generic/images/bg.png
+++ /dev/null
Binary files differ
diff --git a/examples/adding_up_to_10/assets/generic/images/bg.png.bak b/examples/adding_up_to_10/assets/generic/images/bg.png.bak
deleted file mode 100755
index 84f6aaa..0000000
--- a/examples/adding_up_to_10/assets/generic/images/bg.png.bak
+++ /dev/null
Binary files differ
diff --git a/examples/adding_up_to_10/assets/generic/images/fish.png b/examples/adding_up_to_10/assets/generic/images/fish.png
deleted file mode 100755
index 89a5619..0000000
--- a/examples/adding_up_to_10/assets/generic/images/fish.png
+++ /dev/null
Binary files differ
diff --git a/examples/adding_up_to_10/assets/generic/images/flower.png b/examples/adding_up_to_10/assets/generic/images/flower.png
deleted file mode 100755
index 6f3035e..0000000
--- a/examples/adding_up_to_10/assets/generic/images/flower.png
+++ /dev/null
Binary files differ
diff --git a/examples/adding_up_to_10/assets/generic/images/happyChimp_200x209.png b/examples/adding_up_to_10/assets/generic/images/happyChimp_200x209.png
deleted file mode 100755
index 1103ac4..0000000
--- a/examples/adding_up_to_10/assets/generic/images/happyChimp_200x209.png
+++ /dev/null
Binary files differ
diff --git a/examples/adding_up_to_10/assets/generic/images/logo_w_name.png b/examples/adding_up_to_10/assets/generic/images/logo_w_name.png
deleted file mode 100755
index 8943803..0000000
--- a/examples/adding_up_to_10/assets/generic/images/logo_w_name.png
+++ /dev/null
Binary files differ
diff --git a/examples/adding_up_to_10/assets/generic/images/normalChimp_200x209.png b/examples/adding_up_to_10/assets/generic/images/normalChimp_200x209.png
deleted file mode 100755
index 59cdf68..0000000
--- a/examples/adding_up_to_10/assets/generic/images/normalChimp_200x209.png
+++ /dev/null
Binary files differ
diff --git a/examples/adding_up_to_10/assets/generic/images/old.png b/examples/adding_up_to_10/assets/generic/images/old.png
deleted file mode 100755
index 522fb66..0000000
--- a/examples/adding_up_to_10/assets/generic/images/old.png
+++ /dev/null
Binary files differ
diff --git a/examples/adding_up_to_10/assets/generic/images/sadChimp_200x209.png b/examples/adding_up_to_10/assets/generic/images/sadChimp_200x209.png
deleted file mode 100755
index 7dc2d37..0000000
--- a/examples/adding_up_to_10/assets/generic/images/sadChimp_200x209.png
+++ /dev/null
Binary files differ
diff --git a/examples/adding_up_to_10/assets/generic/images/solid_box.png b/examples/adding_up_to_10/assets/generic/images/solid_box.png
deleted file mode 100755
index a3cad30..0000000
--- a/examples/adding_up_to_10/assets/generic/images/solid_box.png
+++ /dev/null
Binary files differ
diff --git a/examples/adding_up_to_10/assets/generic/images/striped_box.png b/examples/adding_up_to_10/assets/generic/images/striped_box.png
deleted file mode 100755
index fb9c720..0000000
--- a/examples/adding_up_to_10/assets/generic/images/striped_box.png
+++ /dev/null
Binary files differ
diff --git a/examples/adding_up_to_10/css/lesson1.css b/examples/adding_up_to_10/css/lesson1.css
deleted file mode 100755
index 9556043..0000000
--- a/examples/adding_up_to_10/css/lesson1.css
+++ /dev/null
@@ -1,26 +0,0 @@
-#karma-main {
- position: relative;
- background-repeat: no-repeat;
- width: 400px;
- height: 400px;
- border: 2px solid black;
-}
-
-#canvas0 {
- position: relative;
- border: 2px solid black;
- width: 395px;
- height: 395px;
- -moz-border-radius: 8px;
- -webkit-border-radius: 8px;
- z-index: 1;
-}
-
-#canvas0 #canvas1 {
- position: relative;
- border: 10px solid black;
- width: 390px;
- height: 350px;
- z-index: 2;
-}
-
diff --git a/examples/adding_up_to_10/css/lesson_multiple.css b/examples/adding_up_to_10/css/lesson_multiple.css
deleted file mode 100755
index acce1f7..0000000
--- a/examples/adding_up_to_10/css/lesson_multiple.css
+++ /dev/null
@@ -1,15 +0,0 @@
-#karma-main {
- /*position: relative;
- background-image: url('../assets/generic/images/bg.png');
- width: 1200px;
- height: 800px;
- */
-}
-canvas {
- border: 2px solid #cccccc;
- image-rendering: optimizeSpeed;
- -moz-border-radius: 8px;
- -webkit-border-radius: 8px;
-}
-
-
diff --git a/examples/adding_up_to_10/css/mytest.css b/examples/adding_up_to_10/css/mytest.css
deleted file mode 100755
index db60f36..0000000
--- a/examples/adding_up_to_10/css/mytest.css
+++ /dev/null
@@ -1,182 +0,0 @@
-
-#main {
-width:800px;
-height:600px;
-position:absolute;
-}
-#action {
-float:left;
-position:relative;
-width: 650px;
-height: 600px;
-
-}
-#sidebar {
-background-image: url(../assets/generic/images/sidebar.png);
--moz-background-clip:border;
--moz-background-inline-policy:continuous;
--moz-background-origin:padding;
-background:none none repeat scroll 0 0;
-float:left;
-height:600px;
-position:relative;
-width:150px;
-}
-#actionTop {
-width: 650px;
-height: 300px;
-position:relative;
-}
-#bottom {
-clear:both;
-float:left;
-width: 650px;
-height: 300px;
-position:relative;
-}
-#topLt {
-float:left;
-width: 300px;
-height: 300px;
-position:relative;
-}
-#topMd {
--moz-background-clip:border;
--moz-background-inline-policy:continuous;
--moz-background-origin:padding;
-background:none none repeat scroll 0 0;
-float:left;
-width: 50px;
-height: 300px;
-position:relative;
-}
-#topRt {
-float:left;
-width: 300px;
-height:300px;
-position:relative;
-}
-#topLtBox {
--moz-background-clip:border;
--moz-background-inline-policy:continuous;
--moz-background-origin:padding;
-background:none none repeat scroll 0 0;
-width: 200px;
-height: 200px;
-left: 75px;
-position:absolute;
-top:50px;
-}
-#topLtCanvas {
--moz-background-clip:border;
--moz-background-inline-policy:continuous;
--moz-background-origin:padding;
-background:none none repeat scroll 0 0;
-position:absolute;
-top: 50px;
-left: 75px;
-}
-#plussign {
-display: block;
-margin-left: auto;
-margin-right: auto;
-margin-top: 150px;
-}
-#topRtBox {
-background: none none repeat scroll 0 0;
-width: 200px;
-height: 200px;
-position:absolute;
-right: 50px;
-top: 50px;
-}
-#topRtCanvas {
-background:none none repeat scroll 0 0;
-position:absolute;
-right:50px;
-top:50px;
-}
-
-.bottom {
--moz-background-clip:border;
--moz-background-inline-policy:continuous;
--moz-background-origin:padding;
-background:none none repeat scroll 0 0;
-float:left;
-width: 216.5px;
-height: 300px;
-position:relative;
-}
-
-.bottomBox {
- left:25px;
- position:absolute;
- width: 200px;
- height: 200px;
- top: 20px;
-}
-
-.sidebarItem {
- clear:both;
- float:left;
- width:150px;
- height: 200px;
- position: relative;
-}
-
-#timer {
-position:absolute;
-width:100px;
-height:150px;
-top:10px;
-left:25px;
-}
-
-#timerCanvas {
-position:absolute;
-width:100px;
-height:150px;
-top:10px;
-left:25px;
-}
-
-#scorebox {
-position:absolute;
-width:100px;
-height:150px;
-top:10px;
-left:25px;
-}
-
-#scoreboxCanvas {
-position:absolute;
-width:100px;
-height:150px;
-top:10px;
-left:25px;
-}
-
-
-#chimpCanvas {
-position:absolute;
-width:120px;
-height:160px;
-top:10px;
-left:25px;
-
-}
-
-#resetButton {
-position:absolute;
-top:20%;
-}
-
-#banana {
-height:0px;
-width:0px;
-}
-#ball {
-height:0px;
-width:0px;
-}
- \ No newline at end of file
diff --git a/examples/adding_up_to_10/js/lesson.js b/examples/adding_up_to_10/js/lesson.js
index b96c10f..7ae5881 100755
--- a/examples/adding_up_to_10/js/lesson.js
+++ b/examples/adding_up_to_10/js/lesson.js
@@ -37,21 +37,19 @@ $(document).ready(function(){
k.main(function() {
- var actionContexts = [ k.surfaces["topLt"].ctx, k.surfaces["topRt"].ctx,
- k.surfaces["bottomLt"].ctx, k.surfaces["bottomMd"].ctx,
- k.surfaces["bottomRt"].ctx];
-
-
var imgNames = ["ball", "banana", "balloon","chilli", "fish", "flower"];
- //game logic
- var total, level=0, time, n0, n1, correct;
- var maskd=200;
- var d=160;
- var choices=[];
- var score = 0;
+ //game logic
+ var total, level=0, time, n0, n1, correct;
+ var maskd=200;
+ var d=160;
+ var choices=[];
+ var score = 0;
+ var correct;
+ var speed = 2000;
+ var playerCorrect = 0;
var endTimerX = 80;
- var startTimerY = 10;
- var endTimerY = 100;
+ var startTimerY = 10;
+ var endTimerY = 100;
var offsetTimerY = 5;
var timerId;
@@ -167,8 +165,8 @@ k.main(function() {
if ( correct === false) {
//answer was incorrect or took too long
- startTimerY = 10;
score = score - 1;
+ playerCorrect = playerCorrect - 1;
writeScore();
if (tooSlow === true) {
k.library.sounds[ "trigger" ].play();
@@ -179,19 +177,24 @@ k.main(function() {
animateChimp(false);
} else {
- startTimerY = 10;
score = score + 1;
+ playerCorrect = playerCorrect + 1;
writeScore();
k.library.sounds[ "correct" ].play();
animateChimp(true);
- level = (level+1)% imgNames.length;
+ if (playerCorrect === 5){
+ level = (level+1)% imgNames.length;
+ speed = speed - 300;
+ playerCorrect = 0;
+ }
}
+ changeTimer('start');
+
};
var animateChimp = function (answer) {
- var timerChimp;
-
+ var timerChimp;
k.surfaces["chimp"].clear();
if( answer === true){
k.library.images["happyChimp"].draw(k.surfaces["chimp"], 0, 0);
@@ -208,6 +211,17 @@ k.main(function() {
};
+
+ var changeTimer = function (status){
+ startTimerY = 10;
+ k.surfaces["timer"].clear();
+ clearInterval(timerId);
+
+ if (status === 'start'){
+ timerId = setInterval(timerFn, speed);
+ }
+
+ };
var startStop = function (start) {
score = level = 0;
@@ -218,11 +232,7 @@ k.main(function() {
}
});
- if (typeof timerId === 'number' ) {
- clearInterval(timerId);
- }
-
- timerId = setInterval (timerFn, 500);
+ changeTimer('start');
game();
@@ -234,11 +244,7 @@ k.main(function() {
var stop = function () {
- startTimerY = 10;
- for (var i = 0; i < 50; i++){
- clearInterval(i);
- }
- k.surfaces["timer"].clear();
+ changeTimer('stop');
};
var reset = function () {
diff --git a/examples/adding_up_to_10/js/lesson_multiple.js b/examples/adding_up_to_10/js/lesson_multiple.js
deleted file mode 100755
index b3aa652..0000000
--- a/examples/adding_up_to_10/js/lesson_multiple.js
+++ /dev/null
@@ -1,57 +0,0 @@
-$(document).ready(function(){
-var k = $.karma ({container: "#karma-main", lang:"es-MX"});
-k.init({
- images: [
- {id: "ball", file: "ball37px.png", localized : false },
- {id: "balloon", file: "balloon.png", localized : false },
- {id: "banana", file: "banana.png", localized : false },
- {id: "chilli", file: "chilli.png", localized : false },
- {id: "fish" , file: "fish.png", localized : false },
- {id: "flower", file: "flower.png", localized : false },
- {id: "plussign", file: "plussign.png", localized : false },
- {id: "happyMonkey", file: "happyMonkey.jpg", localized : false },
- {id: "scorebox", file: "scorebox.png", localized : false }
- ],
- sounds: [
- {id: "correct", file: "correct.ogg", localized:false},
- {id: "incorrect", file: "incorrect.ogg"},
- {id: "trigger", file: "trigger1.ogg", localized:false}
-
- ],
- surfaces: [
- {id: "card1", width:250, height:250},
- {id: "card2", width:250, height:250},
- {id: "card3", width:250, height:250},
- {id: "inline1", canvas:"inlineCanvas1"},
- {id: "inline2", canvas:"inlineCanvas2"}
- ]
-});
-
-k.main(function() {
-
-
- var library = k.library;
- var surfaces = k.surfaces;
- var sounds = library.sounds;
-
- sounds["trigger"].play();
- library.images["ball"].draw( surfaces["card1"].ctx );
- library.images["balloon"].draw( surfaces["card2"].ctx );
- library.images["banana"].draw( surfaces["card3"].ctx );
- library.images["ball"].draw( surfaces["inline1"].ctx );
- library.images["fish"].draw( surfaces["inline2"].ctx );
-
- //surfaces["inline1"].ctx.drawWindow(window, 0, 0, 100, 200, "rgb(0,0,0)");
-
- surfaces["inline2"].addEventListener(
- "click",
- function(){surfaces["inline2"].clear();}
- );
- surfaces["inline1"].fillStyle("#006699").fillRect(0, 0, 150, 150);
- /*
- surfaces["inline1"].ctx.fillStyle = "#00f";
- surfaces["inline1"].ctx.fillRect(0, 0, 150, 150);
- surfaces["card1"].ctx.fillStyle = "#000";
- surfaces["card1"].ctx.fillRect(0, 0, 150, 150);*/
-});
-}); \ No newline at end of file
diff --git a/examples/adding_up_to_10/resources.html b/examples/adding_up_to_10/resources.html
index bb4c85a..0e93455 100755
--- a/examples/adding_up_to_10/resources.html
+++ b/examples/adding_up_to_10/resources.html
@@ -1,10 +1,10 @@
<!DOCTYPE html>
-<html lang="en">
+<html>
<head>
<title>Karma - Adding Up to 10</title>
<meta name="keywords" content="karma,javascript,html5,sugar,sugarlabs,gsoc,ole,nepal" />
<link type="text/css" rel="stylesheet" href="css/lesson.css" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
<link type="image/ico" rel="icon" href="../../assets/default/images/favicon.ico" />
<script type="text/javascript" src="../../js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="../../js/karma.Gettext.js"></script>