/** @type {import('next').NextConfig} */
const nextConfig = {
output: "export",
distDir: "dist",
skipTrailingSlashRedirect: true,
trailingSlash: true,
};
module.exports = nextConfig;
=> ๋น๋ config: 28์ผ ์๋ฒฝ๊น์ง ๊ฒฝ๋ก ์ด์๋ฅผ ํด๊ฒฐํ๊ณ ์ ํ์ผ๋ ์คํจ
// module aliases
var Engine = Matter.Engine,
Render = Matter.Render,
Runner = Matter.Runner,
Bodies = Matter.Bodies,
Composite = Matter.Composite;
- https://www.youtube.com/watch?v=W-9DcLtBhVc
- https://www.youtube.com/watch?v=_r955zGxgFQ
- https://github.com/0shuvo0/Angry-Birds-Clone/blob/main/main.js
- https://www.youtube.com/watch?v=TDQzoe9nslY&t=1865s
- body.create()
- https://github.com/liabru/matter-js/blob/master/src/body/Body.js
- https://github.com/liabru/matter-js/blob/master/examples/slingshot.js
// mouse interaction
const mouse = Matter.Mouse.create(ref.current);
const mouseConstraint = Matter.MouseConstraint.create(engine, { mouse });
Matter.Events.on(mouseConstraint, "enddrag", (e: any) => {
birdsLeft.map((bird) => {
if (!bird) return;
if (e.body === bird) {
isFire = true;
}
});
});
Matter.Events.on(engine, "afterUpdate", () => {
if (!life || birdsLeft.length === 0) return;
if (isFire) {
birdsLeft.shift();
setLife(birdsLeft.length);
const newBird = birdsLeft[0];
if (!newBird) {
sling.bodyB = null;
Composite.remove(engine.world, sling);
} else {
sling.bodyB = newBird;
setTimeout(() => {
Composite.add(engine.world, newBird);
}, 500);
}
isFire = false;
}
});