Discord
Login
Community
DARK THEME

matter.js how to use it ?

I'm include matter.js lib My code:

init = function()
  x=0
  y=0
end

update = function()
end

draw = function()
  screen.clear()
  screen.drawSprite("ball",x,y,8,8)
end

how to give gravity to ball ? how to add wall, that collide with it ? how to detect collides with walls ? how to give impulse to ball ?

You need to add the Matter.js library to your project in settings.

Demo >> https://microstudio.dev/i/JmeJuniper/physicstest/ Demo2 >> https://microstudio.dev/i/gilles/matterjstest/

https://microstudio.dev/documentation/ >>> Help in editor code >> Optional graphics and libs >> Matter.js

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community