Skip to main content
Filter by
Sorted by
Tagged with
Advice
1 vote
1 replies
70 views

I've been trying to recreate Pong (1972) using Matter.js for one of my midterms, and I've been stuck on how to get the ball to move around. I've been having a look at the demos on the website, and ...
agni's user avatar
  • 1
0 votes
0 answers
94 views

when dragging a ball outside of the blue box, it will start to spin fast and if I release the mouse while outside of the bounding box the element will continue to be dragged. I would like to release ...
João Pedro's user avatar
  • 1,008
-1 votes
0 answers
44 views

so i am trying to run a matter instance in a worker thread. Im running it with my own loop as shown below. However I'm experiencing trouble with game pacing. Before getting to the explanation here is ...
lord_drgical's user avatar
0 votes
2 answers
77 views

enter image description here The Problem can be seen in the picture that the small capsules or cards is not taking its priority in the matter.js world. It is being overlapped by userCards or big cards....
Rasil Abro's user avatar
1 vote
1 answer
80 views

I'm trying to mathematically create some shape graphics in Phaser.js, and to attach matching Matter.js physics bodies to them. I'm finding that the coordinate systems used for these two things don't ...
Pathogen's user avatar
  • 1,047
1 vote
1 answer
87 views

I run into an issue with generated bodies in matter.js. if i generate a body from svg via: Matter.Svg.pathToVertices(svgPath, 1) It can happen that the generated Body consists of more shapes like ...
NeoGER89's user avatar
  • 530
3 votes
2 answers
183 views

I'm loading a svg as xml in the preload function: this.load.xml("xml-pipe-bottom", "assets/svg/shape_pipe_b.svg"); and create a body and the svg as sprite: const shapeBody = this....
NeoGER89's user avatar
  • 530
0 votes
1 answer
103 views

I'm trying to integrate a game, built with matter-js, into my existing SvelteKit webapp but am getting stumped as to why gravity is not affecting the circle body I'm adding. The following is the ...
ClosingArc's user avatar
1 vote
1 answer
53 views

I'm trying to use Matter.js for it's physics engine while using D3.js for rendering the Matter physics bodies as SVG elements. This demo is just a box dropping onto the ground. Everything works as ...
Ethan.S's user avatar
  • 63
0 votes
1 answer
56 views

I am making a project using MatterJS. However, I am having some difficulties. Whenever I run my code it throws the error TypeError: Composite.add(...) is not a function. I asked about the problem in ...
Invincible_Atlas's user avatar
1 vote
0 answers
111 views

I am creating a pinball game for a school project. I am using p5.js for graphics and Matter.js for the physics. Everything else in my code is working except for the flippers, which keep firing ...
Lening Zhang's user avatar
2 votes
1 answer
53 views

I want to disable bounced in my io game. Main idea to set object (player) velocity and player must move until io socket command stop movement. sample this.objects[id].setVelocityX (-speed); to prevent ...
Alex Green's user avatar
0 votes
0 answers
47 views

I am currently developing a Plinko game using Matter.js. I’ve written code to ensure that the result is always determined by the ball’s initial position, without any external influence. For example, ...
gafield's user avatar
0 votes
0 answers
61 views

I am simulating a snooker game via JavaScript using the P5 and Matter JS, I'm almost done but I'm having trouble with some of the ball behaviors. I added all the balls to the engine world in Matter JS ...
Ahmad Sekmani  's user avatar
2 votes
0 answers
24 views

I want to achieve a situation where, when I drag the end of the chain to the object on the right, the end sticks to the object (i.e., both sides are parallel). However, I tried adding constraints to ...
RorinL's user avatar
  • 102
0 votes
1 answer
114 views

I am trying to use a 2D physics engine to model a rotating disc with a pin on its edge. The pin can collide with other objects, either preventing the disc from rotating further, or pushing the other ...
rgov's user avatar
  • 4,468
0 votes
1 answer
73 views

I'm currently working on a space flight simulator using matter.js as a game engine. I'm facing a problem with the huge size of the map. If we consider that 1 metre is 10px (adjusted to the size of ...
Hackirus's user avatar
2 votes
1 answer
269 views

I'm trying to use JavaScript to make it so that when certain pieces of text in the document are clicked, they become physical objects and drop down to the bottom of the screen. I'm using matter.js to ...
itsolie's user avatar
  • 23
1 vote
1 answer
48 views

I have a moving platform and box on top of it. No matter how fast the platform is moving, the box doesnt move sideways along with the platform and eventually falls down if the platform slipped away. I ...
NeoGER89's user avatar
  • 530
0 votes
1 answer
389 views

I'm a newbie in matter.js.I'm using Matter.js in NextJS but it is not working and I don't know why. This is just a code that I copy and translate to NextJS components. It displays like this but it ...
Jack Phat's user avatar
0 votes
1 answer
144 views

I Want To Create This Ping Effect. You can see more about it on https://stake.com/casino/games/plinko I'm re-building this plinko game and want to create this effect of a 'ping'. I got to a point ...
Ibra's user avatar
  • 1,082
3 votes
1 answer
257 views

I'm working with Matter.JS for an interactive header graphic on a website. I have some basic letter paths in SVG, which get loaded, converted to shapes and bodies and placed in the world. They get ...
oelna's user avatar
  • 2,486
3 votes
0 answers
237 views

I am using matter-js with react-native-game-engine to create game with a falling body. And then, in setupWorld() function I am defining them, like this: class GameScreen extends Component { ...
JeremyFc's user avatar
  • 224
0 votes
1 answer
122 views

TLDR; How do I make a body draggable only in the bottom half of the screen and release it if user tries to go beyond that specified area? I'm making a simple game using p5.js for rendering and Matter ...
Worker1432's user avatar
0 votes
0 answers
160 views

THE ERROR: This error appears if I use loadImage() function, even if I didn't use the image loaded anywhere else. In this case it is the background image, but even loading images I just want to use on ...
Worker1432's user avatar
1 vote
1 answer
129 views

I want to reset the ball back to its initial position if it flies off the screen, or if its position.y < 0 (I'll add in other boundary conditions once this is figured out). I tried simulating that ...
Worker1432's user avatar
0 votes
1 answer
80 views

In the live simulation available at https://brm.io/matter-js/demo/#newtonsCradle, how can the issue of energy loss be resolved? Despite setting friction to zero, energy loss still occurs. Does anyone ...
texi's user avatar
  • 48
1 vote
0 answers
78 views

I have a simple basketball shooting game built in Phaser 3. It has a ball, a rim with a point on each side where the ball can bounce off of, and a zone underneath the rim that I use to track for ...
Jimmy Blundell's user avatar
1 vote
1 answer
253 views

I'm making a simple flick type basketball game. The game is 2D, but the ball scales smaller after you launch it to give the 3d effect. Where the ball spawns, the rim of the hoop is directly above it ...
Jimmy Blundell's user avatar
0 votes
0 answers
45 views

I am using matter js in my project but it is not visible and throws an error in the console using the live server extension "matter.min.js:6 Uncaught DOMException: Failed to execute 'drawImage' ...
Yash kolte's user avatar
0 votes
1 answer
61 views

Using MatterJS I have a stack of circles and a floor rectangle: var stack = Composites.stack(300, 0, 3, 3, 10, 10, function(x, y) { return Bodies.circle(x, y, Common.random(10, 20), {friction: 0, ...
user500665's user avatar
  • 1,462
0 votes
2 answers
92 views

So I made a little matter.js thing, using javascript and html, it just creates a black floor, where which a rectangle, trapezoid, square, and circle fall on it: <!DOCTYPE html> <html lang=...
Z_Dev's user avatar
  • 23
0 votes
0 answers
177 views

When adding convex SVGs to a matter.js canvas (using the polyfills so they look fine) the movement of these bodies when forces are applied is not correct. I can barely move the bodies at all even when ...
Luke Walker's user avatar
2 votes
1 answer
69 views

const poly1 = this.add.polygon(200, 200, Ployploy, 0x0000ff, 0.2); ThisPlayer = this.matter.add.gameObject(poly1, { shape: { type: 'fromVerts', verts: Ployploy, flagInternal: true } }); //add this ...
Brenden McGraw-Hobbs's user avatar
0 votes
1 answer
196 views

I want to use matter.js on a web worker with offscreen canvas, but the problem is it seems to throw errors about requestAnimationFrame. It tries to get it by using window.requestAnimationFrame but in ...
omega's user avatar
  • 44.6k
0 votes
0 answers
102 views

I am making a RTS game in matter.js, similar to starcraft. One thing I want to implement is panning around with viewports. I created the canvas and the world const canvas = document.getElementById(&...
omega's user avatar
  • 44.6k
0 votes
0 answers
221 views

I am making a game where every time you click, a fruit falls down from the mouse coordinates. The game was working when I was working with plain colours, so then I decided to add textures. However, I ...
ApplesAndCode464's user avatar
0 votes
0 answers
111 views

I have a polygon that I'm trying to make into a Body in matter.js, but it's concave so i've split it into multiple convex polygons as shown below: here is the point data, it's very large But when I ...
Patrick Martin's user avatar
0 votes
0 answers
63 views

I'm trying to create a simple game in React native with matter.js and react-native-game engine. I have created a bunch of shapes which I want to render continuously with a 1 second delay. The shapes ...
Alistair Alva's user avatar
0 votes
1 answer
76 views

I'm developing a Javascript animation using matter.js. Here is the link: https://codepen.io/Sergio-Escalona/pen/VwNrwbw document.addEventListener("DOMContentLoaded", function () { // ...
Sergio Escalona's user avatar
2 votes
1 answer
116 views

I have a simple animation where I have a static rectangle slowly moving horizontally so that it pushes a circle across the 'floor'. How can I make the circle roll instead of slide? I tried adding ...
user500665's user avatar
  • 1,462
3 votes
1 answer
215 views

let Engine = Matter.Engine, Render = Matter.Render, Runner = Matter.Runner, World = Matter.World, Bodies = Matter.Bodies, Constraint = Matter.Constraint; let engine = Engine.create(), ...
Hasam's user avatar
  • 33
0 votes
1 answer
486 views

On my website, I create a matter.js world where I have a bunch of draggable bodies. Any simple ideas on how to create a grab cursor when hovering over the bodies I had, failed. Without it, there is no ...
Baltazar Fajto's user avatar
0 votes
0 answers
95 views

I'm using matter.js in a Next.js project. And I need help. When my Technology block, which is reused on different pages of the application, is located at the top of the page when loading the page, the ...
Наталья Семешенко's user avatar
1 vote
0 answers
54 views

Example, removed gravity, removed friction, made maximum elasticity. The balls still stop. What else can you do to make the balls move endlessly? Or is this a phaser js bug? var config = { type: ...
Роман Кистин's user avatar
1 vote
0 answers
89 views

In my game, I have a scenario where (simple) polygons are created dynamically in parts from vertices. However, I am facing what appears to be a bug with the physics between these Polygons. Take the ...
Calcue's user avatar
  • 11
0 votes
0 answers
56 views

I'm working on a site that uses matter.js in a particular section to add some floating shapes to the background of the div. One of the shapes is a semicircle, which I used svg.js to create the shape. ...
Jono's user avatar
  • 51
0 votes
1 answer
867 views

// matter.js modules let Engine = Matter.Engine, Render = Matter.Render, World = Matter.World, Bodies = Matter.Bodies, Mouse = Matter.Mouse, MouseConstraint = Matter....
RemRDS's user avatar
  • 1
3 votes
1 answer
328 views

I am trying to draw multiple circles in pyramid shape like this: balls in pyramid shape I have made this 'Balls' class: class Balls { constructor(x, y, radius, color, ballCount) { this.x = x; ...
vince's user avatar
  • 33
0 votes
0 answers
205 views

I'm using MatterJS to create a simple tile-based platformer, but running into issues getting both gravity and movement to work together. My goal is to have it so the player is only partially physics ...
zachThePerson's user avatar

1
2 3 4 5
7