From 85a3db07a5d4c6c98c5b74b097c255a3033ccf65 Mon Sep 17 00:00:00 2001 From: Nightre Date: Wed, 14 Feb 2024 13:49:38 +0800 Subject: [PATCH] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e41229d..c5c2311 100644 --- a/README.md +++ b/README.md @@ -263,14 +263,14 @@ class Ball extends Graphical { constructor() { // ... this.collision.onBodyEnter = (res) => { - // res 返回碰到的碰撞体,以及overlap + // `res` returns the collision object encountered and overlay const body = res.body - if (body.tag.has("board")) { // 判断是不是板子 - // 获取与板子之间的差 + if (body.tag.has("board")) { // Determine if it is a board + // Obtain the difference in coordinates with the board const rebound = this.globalPosition.sub(body.globalPosition,true) - // 设置方向 + // Set direction this.direction.direction = rebound.direction - // 播放声音 + // Play Sound engine.getAssets("jump").play() } }