Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/adding_up_to_10_canvas/js/lesson.js18
-rwxr-xr-xexamples/adding_up_to_10_svg/js/lesson.js16
2 files changed, 17 insertions, 17 deletions
diff --git a/examples/adding_up_to_10_canvas/js/lesson.js b/examples/adding_up_to_10_canvas/js/lesson.js
index 852bd3f..ed5d365 100755
--- a/examples/adding_up_to_10_canvas/js/lesson.js
+++ b/examples/adding_up_to_10_canvas/js/lesson.js
@@ -62,7 +62,7 @@ k.main(function() {
if ( startTimerY >= endTimerY ){
//you didn't answer in time
- k.library.sounds["trigger"].play();
+ k.sounds["trigger"].play();
answer(false, true);
game();
}
@@ -137,7 +137,7 @@ k.main(function() {
}while ( flag === true );
pos.push( { "x":x, "y": y } );
- k.library.images[ imgId ].draw(surface, x, y )
+ k.images[ imgId ].draw(surface, x, y )
}
@@ -173,9 +173,9 @@ k.main(function() {
playerCorrect = playerCorrect - 1;
writeScore();
if (tooSlow === true) {
- k.library.sounds[ "trigger" ].play();
+ k.sounds[ "trigger" ].play();
} else {
- k.library.sounds[ "incorrect" ].play();
+ k.sounds[ "incorrect" ].play();
}
//animate sad monkey
animateChimp(false);
@@ -184,7 +184,7 @@ k.main(function() {
score = score + 1;
playerCorrect = playerCorrect + 1;
writeScore();
- k.library.sounds[ "correct" ].play();
+ k.sounds[ "correct" ].play();
animateChimp(true);
if (playerCorrect === 5){
level = (level+1)% imgNames.length;
@@ -201,14 +201,14 @@ k.main(function() {
var timerChimp;
k.surfaces["chimp"].clear();
if( answer === true){
- k.library.images["happyChimp"].draw(k.surfaces["chimp"], 0, 0);
+ k.images["happyChimp"].draw(k.surfaces["chimp"], 0, 0);
} else {
- k.library.images["sadChimp"].draw(k.surfaces["chimp"], 0, 0);
+ k.images["sadChimp"].draw(k.surfaces["chimp"], 0, 0);
}
var restoreChimp = function () {
k.surfaces["chimp"].clear();
- k.library.images["normalChimp"].draw(k.surfaces["chimp"], 0, 0);
+ k.images["normalChimp"].draw(k.surfaces["chimp"], 0, 0);
};
timerChimp = setTimeout(restoreChimp, 800);
@@ -288,7 +288,7 @@ k.main(function() {
document.getElementById('reset').
addEventListener('click', reset, false);
- k.library.images["normalChimp"].draw(k.surfaces["chimp"], 0, 0);
+ k.images["normalChimp"].draw(k.surfaces["chimp"], 0, 0);
//end of Karma.main
diff --git a/examples/adding_up_to_10_svg/js/lesson.js b/examples/adding_up_to_10_svg/js/lesson.js
index ef878d3..eda09b4 100755
--- a/examples/adding_up_to_10_svg/js/lesson.js
+++ b/examples/adding_up_to_10_svg/js/lesson.js
@@ -139,7 +139,7 @@ k.main(function() {
}while ( isOverlapping === true );
positions.push( { "x":x, "y": y } );
imageVarNames[varPrefix][i] = card.paper.
- image(k.library.images[imageId].src, x , y, 35, 35);
+ image(k.images[imageId].src, x , y, 35, 35);
card.set.push(imageVarNames[varPrefix][i]);
}
@@ -209,9 +209,9 @@ k.main(function() {
numCorrectAnswers = numCorrectAnswers - 1;
writeScore(score);
if (tooSlow === true) {
- k.library.sounds.trigger.play();
+ k.sounds.trigger.play();
} else {
- k.library.sounds.incorrect.play();
+ k.sounds.incorrect.play();
}
//animate sad monkey
animateChimp(false);
@@ -220,7 +220,7 @@ k.main(function() {
score = score + 1;
numCorrectAnswers = numCorrectAnswers + 1;
writeScore(score);
- k.library.sounds.correct.play();
+ k.sounds.correct.play();
animateChimp(true);
if (numCorrectAnswers == 5){
level = level + 1;
@@ -316,7 +316,7 @@ k.main(function() {
"width": 800, "height": 600, "z-index": 10});
$('#overlayPaper').css({"position": "absolute", "z-index": "100", "opacity": 1});
congratsChimp = overlayCard.paper.image(
- k.library.images.happyChimp.src, 200, 100, 300, 400);
+ k.images.happyChimp.src, 200, 100, 300, 400);
congratsChimp.attr({"fill-opacity": "1", "opacity": "1"});
congratsText = overlayCard.paper.text(400, 550, "Great Job!");
congratsText.attr({"font-size": 80});
@@ -347,11 +347,11 @@ k.main(function() {
//Set up the monkeys
chimpPaper = Raphael('chimpPaper', 120, 125);
- normalChimpImage = chimpPaper.image(k.library.images.normalChimp.src,
+ normalChimpImage = chimpPaper.image(k.images.normalChimp.src,
0, 20, 100, 100);
- sadChimpImage = chimpPaper.image(k.library.images.sadChimp.src,
+ sadChimpImage = chimpPaper.image(k.images.sadChimp.src,
0, 20, 100, 100);
- happyChimpImage = chimpPaper.image(k.library.images.happyChimp.src,
+ happyChimpImage = chimpPaper.image(k.images.happyChimp.src,
0, 20, 100, 100);
happyChimpImage.hide();
sadChimpImage.hide();