From 104606e94340e8ac0733c41b919e9e07033eed0d Mon Sep 17 00:00:00 2001 From: Aditya Date: Sun, 22 Dec 2024 20:03:17 +0530 Subject: [PATCH 1/3] Fix: On collision of frog with rock a part of rock is erased Signed-off-by: Aditya --- activities/FoodChain.activity/playgame.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/activities/FoodChain.activity/playgame.js b/activities/FoodChain.activity/playgame.js index 40f30ebdd..9d24f3895 100644 --- a/activities/FoodChain.activity/playgame.js +++ b/activities/FoodChain.activity/playgame.js @@ -624,6 +624,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; } From 854ef948cdce5f9a434ec11732d4ee255dd21e59 Mon Sep 17 00:00:00 2001 From: Aditya Date: Sun, 22 Dec 2024 22:51:34 +0530 Subject: [PATCH 2/3] Fix: Frog image incomplete sometimes Signed-off-by: Aditya --- activities/FoodChain.activity/playgame.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/activities/FoodChain.activity/playgame.js b/activities/FoodChain.activity/playgame.js index 9d24f3895..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(); }, From 10fc208399c2942821f3786ed89d9956063d053f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lionel=20Lask=C3=A9?= Date: Mon, 23 Dec 2024 15:37:13 +0100 Subject: [PATCH 3/3] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) 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