Skip to content

Instantly share code, notes, and snippets.

@anchetaWern
Last active May 27, 2019 05:20
Show Gist options
  • Select an option

  • Save anchetaWern/a79eb4609a401bd99171d1e8a2c97003 to your computer and use it in GitHub Desktop.

Select an option

Save anchetaWern/a79eb4609a401bd99171d1e8a2c97003 to your computer and use it in GitHub Desktop.
React Native Accelerometer Maze: Set up goal
// App.js
const GOAL_SIZE = Math.floor(width * .04);
const goalPoint = GetRandomPoint(GRID_X, GRID_Y);
const goal = Matter.Bodies.rectangle(goalPoint.x, goalPoint.y, GOAL_SIZE, GOAL_SIZE, {
isStatic: true,
isSensor: true,
label: 'goal'
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment