Thanks for developing such an awesome framework, and having such good tutorials. I do have one question that I was wondering if someone could take a look at. I'm doing the firs tutorial on you-tube, and I am having a problem with getting a positive score when I click on my "mole" or (pop) object. Before I entered the second perimeter for getting a negative score --, my positive score was working. If anyone can point out the possible problem, I would be much obliged.
Dan
App = function(){ this.load = function() { wade.loadImage('pop.png'); wade.loadImage('background.png'); wade.loadImage('rocks.png'); }; this.init = function() { var score = 0; var scoreText = new TextSprite(score.toString(), '34px Arial', 'red'); var scoreObject = new SceneObject(scoreText); scoreText.setPosition(-220, 230); wade.addSceneObject(scoreObject); var sprite = new Sprite('pop.png', 20); var pop = new SceneObject(sprite); wade.addSceneObject(pop); pop.setPosition(-220, 230); pop.moveTo(-220, 170, 100); pop.state = 'down'; pop.onMoveComplete = function() { if (pop.state == 'down') { pop.state = 'up'; pop.moveTo(-220, 230, 100); } else if (pop.state == 'up') { pop.state = 'down'; pop.moveTo(-220, 170, 100); } }; pop.onMouseDown = function() { score++; scoreText.setText(score); return true; }; wade.addEventListener(pop, 'onMouseDown'); var rockSprite = new Sprite('rocks.png', 10); var background = new Sprite('background.png', 30); var bkrnd = new SceneObject([rockSprite, background]); wade.addSceneObject(bkrnd); bkrnd.onMouseDown = function() { score--; scoreText.setText(score); return true; }; wade.addEventListener(bkrnd, 'onMouseDown'); }; };