diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c4b87652..85463815d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Activity Description opening downwards in Journal #1407 - Listview Popup increasing page length and opening downwards for lower icons #1674 - Vertical bar are broken in Chart/Gears activities on Windows #1646 +- In the activity of food chain, the picture of frog shows incomplete #1191 ## [1.8.0] - 2024-04-10 ### Added diff --git a/activities/FoodChain.activity/playgame.js b/activities/FoodChain.activity/playgame.js index 40f30ebdd..c0a591d77 100644 --- a/activities/FoodChain.activity/playgame.js +++ b/activities/FoodChain.activity/playgame.js @@ -312,6 +312,11 @@ enyo.kind({ // Move frog this.frog.unDraw(this.ctx); + // Undraw and redraw all the rocks + for (var i = 0; i < this.rocks.length; i++) { + this.rocks[i].unDraw(this.ctx); // Clear the rock from the canvas + this.rocks[i].draw(this.ctx); // Redraw the rock in its original position + } if (newHeading != this.frog.getHeading()) { // Just change heading this.frog.setHeading(newHeading); @@ -446,6 +451,8 @@ enyo.kind({ currentfly.setY(dummyfly.getY()); currentfly.setHeading(dummyfly.getHeading()); currentfly.draw(this.ctx); + this.frog.unDraw(this.ctx); + this.frog.draw(this.ctx); currentfly.playSound(); }, @@ -624,6 +631,11 @@ enyo.kind({ this.frog.useImage(0); this.frog.draw(this.ctx); this.frog.alive = true; + // Undraw and redraw all the rocks + for (var i = 0; i < this.rocks.length; i++) { + this.rocks[i].unDraw(this.ctx); // Clear the rock from the canvas + this.rocks[i].draw(this.ctx); // Redraw the rock in its original position + } return; }