Skip to content

Commit

Permalink
Merge pull request #29598 from code-dot-org/jul10-displace-bug
Browse files Browse the repository at this point in the history
Create edge sprites when needed
  • Loading branch information
ajpal committed Jul 10, 2019
2 parents 28fcc2a + b44374c commit 53165ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 6 additions & 0 deletions apps/src/gamelab/spritelab/actionCommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,16 @@ export const commands = {
});
},
edgesDisplace(spriteId) {
if (!this.edges) {
this.createEdgeSprites();
}
let sprites = spriteUtils.getSpriteArray(spriteId);
sprites.forEach(sprite => this.edges.displace(sprite));
},
isTouchingEdges(spriteId) {
if (!this.edges) {
this.createEdgeSprites();
}
let sprites = spriteUtils.getSpriteArray(spriteId);
let touching = false;
sprites.forEach(sprite => {
Expand Down
1 change: 0 additions & 1 deletion apps/src/gamelab/spritelab/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ function updateTitle() {

export const commands = {
executeDrawLoopAndCallbacks() {
this.createEdgeSprites();
drawBackground.apply(this);
spriteUtils.runBehaviors();
spriteUtils.runEvents(this);
Expand Down

0 comments on commit 53165ff

Please sign in to comment.