Jump to content

Search the Community

Showing results for tags 'matterjs'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 24 results

  1. I’m trying to make a game with a rocket ship navigating in a cave. The cave is broken up into 400x400 big tiles that’s combined to form a bigger cave. They all have physics-maps from “PhysicsEditor” that seems to work correctly. My tileclass: export default class Tile extends Phaser.Physics.Matter.Sprite { constructor(scene, x, y, sprite, phymap) { super(scene.matter.world, x, y, sprite, 0, { shape: phymap }); this.setStatic(true); this.setBounce(0.05); scene.add.existing(this); } } And these are added in game.js: tilemap[1][0] = new Tile(this, 0, 0, 'ground', tile_body.ground) tilemap[0][0] = new Tile(this, -400, 0, 'bottom-left', tile_body.bottom_left) tilemap[0][1] = new Tile(this, -400, -400, 'vertical', tile_body.vertical) But the tiles are all over the place, if I set them all on position (0, 0) you can see it more clearly: Any ideas to what I am doing wrong? I thought all would be on top of each other if created at position (0, 0) with the same height and width?
  2. Hello, I'm looking for feedback on my first game/mobile app: Amazeballs! https://play.google.com/store/apps/details?id=nl.eyeseet.maze It is a maze-escape game written in using Matter-js and Three.js and runs as an android app using Cordova. There are currently two modes, a top view mode and a 3D ground mode. As you finish levels you earn coins to buy upgrades (speed, manoeuverability and camera zoom out) which should help you finish larger mazes. I'd love to hear what you think of the game. Any feedback or ideas to improve the game are very welcome! Since I've seen the game grow it is hard for me to look at it with fresh eyes. It is hard to judge whether the game is still fun to play after a few levels, if the money/upgrade system balanced, etc. Also, I'd like to add new game modes, I have some ideas but more ideas are more than welcome. In the current version you start with 5000 coins so you can unlock both game modes right away.
  3. Squid Books is looking to augment its team to build physics based games in PixiJS and MatterJS. Squid Books is an educational platform aimed at making Science accessible. At the core, there is a flexible reader whose learnings are strengthened by surrounding quizzes, videos, and word games. The next initiative is to build games demonstrating NGSS’s Earth and Space Science concepts. We are looking for part-time to full-time contractors/consultants which can lead to salaried employment. ~Additional Information~: - Website: https://squidbooks.com/ - SAAS Vendors: Google Cloud Platform, CircleCI, Sentry, Atlassian - Frameworks: React, Express, Cypress, Storybook, PixiJS, MatterJS Please email DM or email us at [email protected].
  4. Sup my dudes, My latest game Bouncy Woods was released just yesterday on Poki - https://poki.com/en/g/bouncy-woods It was developed with Phaser 3 and MatterJS. Matter was pain in ass to deal with because I really needed "bullet" like bodies for this game and Matter doesn't support it. So sometimes you can notice "tunneling" issue - when balls go through blocks. If you have any feedback or questions regarding the game - please let me know. Gameplay video
  5. Hi, I want to create this module, it's composed with 4 connectors and a main module. I created each using the: this.scene.matter.add.sprite I would like to be able to batch them togheter and simply call: module.setPosition(x, y) to move all of it. It would me nice too (but not required) if I was able to batch multiple modules to create a space station and be able to move everything. I Tried with Matter Compound Bodies, but it seams that it can only compound matterjs pure bodies, not those with sprites attached to it. * I followed this example: http://labs.phaser.io/edit.html?src=src\game objects\tilemap\collision\matter platformer with wall jumping.js I saw the new container feature but I dont know if it supports physics objects nor I was able to test it with the container branch. Can you guys help me pointing to a direction?
  6. Hi, I was using matter physics and tried to check collisions from a lot of objects and then I got some issues. The problem: I have a lot of objects (called them "luz" in the code) and I want to release them on air and making them fall. Then when they touch the floor I want to trigger something: - if it is a even object: I want to reduce its Alpha to 30%. - if is an odd object: I reduce their scale by half. Currently I'm handling this situation in my real project by checking update() { if (luz[i].y > floor.Y) { /* do something */ } /*...*/ } but I'm looking for a better and more flexible and robust solution. So here is my code: class GameScene extends Phaser.Scene { constructor () { super('GameScene'); } preload() { this.load.image('luz', 'luz.png'); } create() { // create elements on air for (var i=1; i<=7; i++) { var luz = this.matter.add.image(i*100 + 10, 50, 'luz') luz.body.label = i%2 == 0 ? "even luz" : "odd luz" } // add the floor this.matter.add.rectangle(400, 550, 800, 50, {isStatic: true}).label = "floor" // check collisions this.matter.world.on('collisionstart', function (event, object1, object2) { // this only prints the first object console.log(object1.label + " collides with " + object2.label) switch (object1.label) { case "odd luz": object1.gameObject.alpha = 0.3; break; case "even luz": object1.gameObject.setScale(0.5); break; } }) } } Live example here: https://codepen.io/akuma119/pen/zYvKzgW Video showing the problem: https://i.imgur.com/jU7UiaW.mp4 My questions are: - Am I handling collisions correctly? is this the proper way? - Should I implement my own collision checking system? - Is checking by label a bad design/practice? Thank you for your time and help!
  7. 1-) I am new at phaser and I look for phaser3 Matter physic tutorials. 2-) Is there a way to search in phaser3 tutorials. It is too hard to find proper tutorial. https://phaser.io/news/category/tutorial
  8. I am creating a platformer with Phaser3 and I am using Matter for my physics engine. I have loaded my tilemap/set into the world, however, I don't know if the collisions are working because since I have added in this code, my sprite has disappeared. Why is this? How do I get my sprite to appear again so that I can make sure he collides with the tiles? //Create tilemap const map = this.make.tilemap({key: 'map'}); //Create tileset const tileset = map.addTilesetImage('tiles'); const platforms = map.createDynamicLayer(0, tileset, 0, 0); map.setCollisionByExclusion([-1, 0]); this.matter.world.convertTilemapLayer(platforms); //Update the game at 30Hz this.matter.world.update30Hz(); //Get hitboxes this.shapes = this.cache.json.get('shapes'); //Set boundaries for physics this.matter.world.setBounds(0, 0, game.config.width, 750); //Player this.hero = this.matter.add.sprite(0, 0, 'sheet', 'run_right/0013', {shape: this.shapes.s0013}); //Don't want him rotating in the air this.hero.setFixedRotation(); //Set our variable to do calculations heroSize = this.hero.width;
  9. Does anyone know how to disable wireframe mode and change body colors while using MatterJS for physics? I can see the following properties in the body's render object, but the color is not updating. It looks like wireframes are set to true by default (line 59) - https://github.com/photonstorm/phaser/blob/8af70d02d1f42a0b56e618840d27b2d1807848cf/src/physics/matter-js/lib/render/Render.js Thanks!
  10. https://gyazo.com/4a44909a40952ac6f5182d328f55d754 I've spent more time than I care to admit figuring it all out. I'm calculating a convex hull around a sprite and then slicing it up into matterjs driven little orc pieces. I'm not very happy with one thing yet. Each of these pieces is a separate Sprite and it has it's own Graphics object as a mask. I feel that if I were to have a couple of these going at the same time rendering could get expensive. Teach me to do better I should be learning react or something to get a dev job, but here I am cutting up orcs.
  11. I would like to share a website I built with Phaser 3. I believe Phaser is going to change the way we interact with online content, and I would love to play a part in that change. Here is the website: https://cannabijoy.com/ Although I have a desktop version, I recommend you check it out on your smartphone. The entire website was built on my phone, so mobile browsers will get most of the attention. In fact, the only time I’ve used a PC is to make sure my code is working. The mini games are built to show off the capability of Phaser, but I’m currently working on a platform puzzler with my slingshot character. I do believe these are the first games built with Phaser that utilize a slingshot, and if my website becomes successful, I hope one day to teach the functionality in my tutorials. For now I’m trying to establish myself as a programmer, because I don’t actually work in this field. Any feedback will be greatly appreciated. Thanks for checking it out!
  12. I found in my project that when objects are moving fast enough the colliders no longer work. Do I need to be increasing the mass or something so collisions register when an object is moving fast? You can see an example by going to the Collision Filter example (https://labs.phaser.io/edit.html?src=src\physics\matterjs\collision filter.js) and setting the bounce (on line 31) to 3
  13. How do I enable MatterJS based physics in my group bodies? I have the following: this.bullets = this.scene.add.group({ key: 'bullet', frame: 0, repeat: 5, maxSize: 10, setXY: { x: 32, y: 100, stepX: 40 } }); And I'm noticing the body value (at the bottom) is 'null' Based on this tutorial - https://phaser.io/tutorials/making-your-first-phaser-3-game/part8 It uses 'this.physics.add...' but unfortunately, 'this.physics' isn't available. Perhaps because I'm not using Arcade Physics? I also tried 'this.bullets.enableBody = true;' which doesn't seem to do anything. Thoughts?
  14. I'm attempting to clear the path within the update function, you can see below: But for some reason, the path won't clear class Gun extends Phaser.Physics.Matter.Image { constructor(config, scene) { super(config.world, config.x, config.y, null, null, config.options); this.scene = scene; this.ship = this.scene.player this.graphics = this.scene.add.graphics(); this.path = new Phaser.Curves.Path(0, 0); } update() { this.graphics.clear() this.graphics.lineStyle(1, 0xcccccc, 1); this.path.lineTo(this.ship.x, this.ship.y); this.path.lineTo(this.scene.input.mousePointer.x, this.scene.input.mousePointer.y); this.path.draw(this.graphics) } } export default Gun; Here's the live demo - https://codepen.io/jurbank/project/live/AmPBBN/ And the project - https://codepen.io/jurbank/project/editor/AmPBBN Any thoughts? Thanks!
  15. Hi all, I've been stuck on this issue for a few days now. I'm working on a game that relies on sleep events and removing the object beneath the matter physics image (so that it continues to fall). Only issue is after the sleep event is fired and I remove the image beneath the dynamic object, I can't get the physics object to move again. Any help would be appreciated. I would like to know if this is impossible as well so that I can look at other solutions. Thanks! Hugh
  16. I'm trying to make a game where the user can drag parts to attach to the Ship. The main challenge I'm running into is attaching the bodies into a single, fixed group so when the player thrusts around with the arrow keys, the other bodies stay in-place. I was looking into composites but I'm not sure how to use them in Phaser, looks pretty straight forward in standard MatterJS. I was also playing with constraints and joints but those seem to attach at one point between both bodies. I also tried adding two constrains, one at each edge but it seemed like the 2nd overwrote the 1st. Any thoughts? Here's my code playground - https://codepen.io/jurbank/pen/Mqqyow?editors=0011
  17. Hi guys, I have different objects in my game, something like this scene.matter.add.image(x, y, 'car'); scene.matter.add.image(x, y, 'cone1'); scene.matter.add.image(x, y, 'man'); And I try identify what kind of objects collides this.matter.world.on('collisionstart', (event, bodyA, bodyB) => { if (bodyA.label === 'car' && bodyB.label === 'cone') { bodyB.cone.body.setTexture('cone2'); } if (bodyA.label === 'cone' && bodyB.label === 'car') { bodyA.cone.body.setTexture('cone2'); } if (bodyA.label === 'man' && bodyB.label === 'cone') { bodyB.cone.body.setTexture('cone1'); } if (bodyA.label === 'cone' && bodyB.label === 'man') { bodyA.cone.body.setTexture('cone1'); } }); But sometimes cone object don't change his texture despite I hit it by a car. If it can help, full code there - https://gitlab.com/grigoriytretyakov/phaser3-racing-car/blob/master/src/Game.js#L172
  18. Hello, I am new to phaser and trying to learn phaser 3. I need a revolute constriant for a project. There are examples for phaser 2 using box2d and p2physics, but they wont work in phaser 3. I tried looking that in documentation but i don't think it is complete yet. Can anybody please tell me how to create a revolute constraint (or pin joint) in phaser 3 (preferably in matter js). Thanks
  19. Hi everyone, I'm pretty new to Phaser, only started with it yesterday. I'm building a world with some image assets, in this case, trees that my player object will have to collide with. The code looks like this: var treeLeft = this.matter.add.image(0, (gameHeight - 96), 'tree', null, { isStatic: true }).setOrigin(0, 1); As you can see I'm adding them with Matter.js and then telling them to be static. However, my setOrigin(0, 1) is throwing off the bounding box that Matter.js assigns to the image object. Do you know of any way to make the physics bounding box coincide with my image's visible bounds? I'd like to keep the setOrigin as is because it simplifies the actual map building process for me greatly. Thanks in advance, Emile.
  20. How can I set the direction at which an object should be moving at in MatterJS physics? In Arcade physics I'd do `this.scene.physics.velocityFromRotation(angle, this.speed, this.velocity);`, but MatterJS doesn't seem to have a `velocityFromRotation` method.
  21. Hey guys, I'm trying to recreate the example code in Phaser 3 from this sample code as it seems Matter.js is much better suited for what I'm trying to achieve than Arcade and wanted to just get an example working locally. http://labs.phaser.io/edit.html?src=src\physics\matterjs\attractors.js When I run this in my own project I get ` this.matter is undefined ` Is there a separate script I'm meant to include like there was in the dist folder for 'phaser-arcade-physics.js' on the repo https://github.com/photonstorm/phaser/tree/master/dist
  22. I'm using Matter.js as my physics engine and Pixi as my renderer and under normal circumstances I've been able to get them to work smoothly. However, I'm trying to do something where all of the objects *except* the player character are scaled down to look like the character is now above them. The scaling works visually in Pixi, but I can't get the bodies from Matter.js to go with it, so there are these "ghost objects" that I can't see but if collide with them then the scaled down objects will be moved. Does anyone have any tips for how to resolve this? Let me know if I need to post a gif if that would help explain the problem.
  23. staff0rd

    ZigZag

    ZigZag is a short, re-imagining of the classic Snake game - and another collab with @TM999. Uses pixijs which I've become quite familiar with now, and is my first attempt at integrating matterjs. I'm again using GSAP for all movement, and howlerjs for sound. matterjs is in there for collision detection, but due to the nature of the game I don't need to update the physics every tick, rather I call an update on the engine only when the player performs an action. I'm completely new to physics engines, and the static? structure of matterjs functions took a while to get up to speed, but once you get a feel for the library it works pretty well and seems quite performant. There is some glue required considering pixijs is responsible for the graphics scene tree, and matterjs is responsible for the bodies, but the end result is quite nice, so I do recommend others to try matterjs if you haven't already. Play on Web Play on iOS Play on GooglePlay
  24. Matter.js v0.8.0-alpha a JavaScript 2D rigid body physics engine for the web DemoMobile DemoFeaturesUsage DownloadDocumentationChangelogIssues Project PageGitHubCodePenTwitterLicense (MIT) It's about time I opened a thread here for this, since I just released a new version! Matter.js is (another!) 2D physics engine for HTML5 games. Competition is always good It's currently still alpha, but it's pretty stable and performance is very good (e.g. the mobile demo pulls 60FPS on a Nexus 4). Note that it's not a complete game engine or a framework, but it has the components to get started including a game loop and renderer. See the links at the start of the topic for lots more info. Hope you guys like it, cheers!
×
×
  • Create New...