Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import {addScore} from "./HUD";
//part of full code
export default class block extends Mesh {
public onUpdate(): void {
if ((this.intersectsMesh(this._ball)) && this.callFlag== false){
this.callFlag=true;
this.blockDispose();
}
}
private async blockDispose():Promise<void>{
const sleep = (second) => new Promise(resolve => setTimeout(resolve, second ));
await sleep(200);
this.dispose();
addScore();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment