Created
September 6, 2020 07:19
-
-
Save flushpot1125/2ccec5924e45391baac1c8e40f65d87a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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