MCPcopy
hub / github.com/feichao93/battle-city / testCollide

Function testCollide

app/utils/common.ts:37–42  ·  view source on GitHub ↗
(subject: Rect, object: Rect, threshhold = 0)

Source from the content-addressed store, hash-verified

35
36/** 用来判断subject和object是否相撞 */
37export function testCollide(subject: Rect, object: Rect, threshhold = 0) {
38 return (
39 between(subject.x - object.width, object.x, subject.x + subject.width, threshhold) &&
40 between(subject.y - object.height, object.y, subject.y + subject.height, threshhold)
41 )
42}
43
44export const frame = (x: number) => (1000 / 60) * x
45

Callers 15

isTankCollidedWithEagleFunction · 0.90
isTankCollidedWithBricksFunction · 0.90
isTankCollidedWithSteelsFunction · 0.90
isTankCollidedWithRiversFunction · 0.90
availableSpawnPositionFunction · 0.90
calculateHitTimeFunction · 0.90
handleTankPickPowerUpsFunction · 0.90
destroyEagleIfNeededFunction · 0.90

Calls 1

betweenFunction · 0.85

Tested by

no test coverage detected