Skip to content

Commit 6445b2c

Browse files
author
Lionel Laské
committed
Merge branch 'pr/1681' into dev
2 parents a8202f4 + 10fc208 commit 6445b2c

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
3535
- Activity Description opening downwards in Journal #1407
3636
- Listview Popup increasing page length and opening downwards for lower icons #1674
3737
- Vertical bar are broken in Chart/Gears activities on Windows #1646
38+
- In the activity of food chain, the picture of frog shows incomplete #1191
3839

3940
## [1.8.0] - 2024-04-10
4041
### Added

activities/FoodChain.activity/playgame.js

+12
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,11 @@ enyo.kind({
312312

313313
// Move frog
314314
this.frog.unDraw(this.ctx);
315+
// Undraw and redraw all the rocks
316+
for (var i = 0; i < this.rocks.length; i++) {
317+
this.rocks[i].unDraw(this.ctx); // Clear the rock from the canvas
318+
this.rocks[i].draw(this.ctx); // Redraw the rock in its original position
319+
}
315320
if (newHeading != this.frog.getHeading()) {
316321
// Just change heading
317322
this.frog.setHeading(newHeading);
@@ -446,6 +451,8 @@ enyo.kind({
446451
currentfly.setY(dummyfly.getY());
447452
currentfly.setHeading(dummyfly.getHeading());
448453
currentfly.draw(this.ctx);
454+
this.frog.unDraw(this.ctx);
455+
this.frog.draw(this.ctx);
449456
currentfly.playSound();
450457
},
451458

@@ -624,6 +631,11 @@ enyo.kind({
624631
this.frog.useImage(0);
625632
this.frog.draw(this.ctx);
626633
this.frog.alive = true;
634+
// Undraw and redraw all the rocks
635+
for (var i = 0; i < this.rocks.length; i++) {
636+
this.rocks[i].unDraw(this.ctx); // Clear the rock from the canvas
637+
this.rocks[i].draw(this.ctx); // Redraw the rock in its original position
638+
}
627639
return;
628640
}
629641

0 commit comments

Comments
 (0)