Skip to content

Commit

Permalink
Merge branch 'prove' of github.com:CoderDojoTrento/botch-vm into prove
Browse files Browse the repository at this point in the history
  • Loading branch information
raffaelepojer committed Sep 7, 2020
2 parents a393ce2 + d3c45e7 commit 49d2960
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/extensions/botch/botch-storage-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,15 @@ class BotchStorageHelper extends Helper {
}
return ret;
}


/**
* Resets the store
*
* @since botch-0.3
*/
clear (){
this.assets = {};
}

}

Expand Down
49 changes: 49 additions & 0 deletions src/extensions/botch/enemy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 12 additions & 1 deletion src/extensions/botch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Scratch3Botch {
}

constructor (runtime) {
this.debugMode = true;
this.debugMode = false;
this.runtime = runtime;
this.storage = this.runtime.storage;
// map that contains the organism <id, org> or enemies
Expand Down Expand Up @@ -96,7 +96,10 @@ class Scratch3Botch {
// copy the custom state when clone
this._onTargetCreated = this._onTargetCreated.bind(this);
this.runtime.on('targetWasCreated', this._onTargetCreated);
this.resetStorage = this.resetStorage.bind(this);
this.runtime.on('PROJECT_START', this.resetStorage);
}


switchDebugMode (){
this.debugMode = !this.debugMode;
Expand Down Expand Up @@ -785,6 +788,14 @@ class Scratch3Botch {
retp.md5 = newId;
return retp;
}

/**
* @since botch-0.3
*/
resetStorage (){
this.storageHelper.clear();
this.runtime.emit(Scratch3Botch.BOTCH_STORAGE_HELPER_UPDATE);
}

/**
* Loads a sprite from the store
Expand Down
24 changes: 24 additions & 0 deletions src/extensions/botch/plankton.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions src/extensions/botch/poison.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 49d2960

Please sign in to comment.