• Content Count

  • Joined

  • Last visited

  • Days Won


obiot last won the day on December 27 2020

obiot had the most liked content!

About obiot

  • Rank
    Advanced Member
  • Birthday July 20

Contact Methods

  • Website URL
  • Twitter

Profile Information

  • Gender
  • Location

Recent Profile Visitors

4414 profile views
  1. obiot

    Multiple shaders

    Hi, in the latest 8.x branch we did revamp partially the WebGL implementation, and introduced a new GLShader class which aims to be the base in providing such a multiple shader feature, with the possibility to specify a Shader manually .Unfortunately for now beside switching between the 2 shaders used internally for primitive drawing and sprite it has not been really tested, and probably the current code needs further changes to allow it (now we have one compositor used for both primitive drawing and sprite rendering that automatically switch shader , it should be split into two compositor, allowing for each to use a user defined shader)
  2. hi, can you copy paste the part of the code doing the scaling here just to be sure ? also is this on a me.Sprite object ? or for/in a an Entity ?
  3. Hi, thanks for the feedback ! "Parallax" layer has been a long due/requested feature, but nobody never got to actually implement it : this said, changing the layer position should work (I don't see right now why it should not), what version of melonJS are u using ?
  4. there were a massive rewrite in the version 8 compared to version 7 yes, with better detection and fallback to canvas, and also WebGL2 support, so you should actually see performances improvement but this might be linked the the below changes on older computer with 2 GPU, as browser are all switching to a low-power mode by default, as opposed to the previous "high-performance" Renderer : allow specifying the default powerPreference value for the WebGL Renderer (on Safari and Chrome 80+ default is now low-power) see here for the WebGL specs : my pleasure and merry Christmas to you too ! I have done anything in a while, between moving house and holiday period, I;ll only be back in January
  5. yes, but at that point it's either you set `failIfMajorPerformaceCaveat` to false and games won't work on some linux platform (this was one of the issue in the past), or true but then windows machines that don't have a good enough WebGL driver implementation will fallback to canvas.... unless you have a good idea, not much more I can do about this to be honest...
  6. interesting question ! I would see two options : OPTION 1 : using a regular physic body with a open polygon or several line shapes, you can know when your body (a polyline then here) is intersecting with any other shape, the trick being to check if both edge are respectively within these two circles, but something you can easily do by testing which line in your body is the one intereseting with a circle and keep track of the circles during the update cycle. OPTION 2 : I would definitely look as well at the raycast feature (demo here). the only thing is that you have to work around it a bit as the raycast method only take a me.Line object as parameter, so you will have to decompose the line here above, but then it's easy as the below pseudo-code: var results = me.collision.rayCast(myLine1); results.forEach(result) { if isCircle(result) && result.contains(myLine.points[1) { // do something amazing } } Also do not that the rayCast method relies on the quadtree to only check against the nearby object
  7. in the Tiled screenshot here above, your foreground layer is marked as hidden (see the closed eye), are you sure this is not a setting "issue" in tiled ? the error you mentioned is just actually a warning, but it does not prevent the the texture from being used. We display warning about non-POT texture as it impacts performances with WebGL, but does not prevent the game from working. also, if you are on the latest 8.x version, you can actually enable WebGL2 that now accepts non-POT, by setting the preferWebGL1 flag to false : Else the whole tutorial source code is available on GitHub : I understand your frustration, but the tutorial is not only about melonJS, it's also about the 3rd party tools (like Tiled), and yes it's easy to make a mistake, and yes it's definitely a learning process. keep us updated on your progress, and do come back here if you need more help
  8. obiot

    CDN and NPM install

    I'm not sure why you do like this, why don't you just include melonJS in your package.json ? this is will install it with other dependencies, and then the call to require should work.
  9. just to be clear though, the build process in the boilerplate is to actually build a one file minified version of the game, and additionally automatically generate the asset file. nothing prevent from actually using the boilerplate "manually" by running the provided index html file, without building the whole thing (or even just not using the boilerplate, it's not mandatory) and manually building the resources file yourself :
  10. just added this too :
  11. Hi, Again with this error ! (facepalm) are you using the latest version of the boilerplate ? this was addressed in the latest commits ( see as well here : but yes the boilerplate really/definitely needs a big update (remove grunt) and switch to either webpack or rollup
  12. obiot


    Sorry for the late answer, normally you should have all you need here : - you can check if b is an instance of a ladder object - use the overlapV vector to determine by "how much" your player collides with the ladder, I would rather use that instead of binA, as there is little chance the player is always completely inside the ladder (see in your picture it is overlapping, but not completely inside, check the collision box, in red, using the Debug panel) as for types, this is more to limit which object the main player (or others can collide with), but by default this is mostly all of them, so it should not be an issue let me know if this helps, or if you managed to implement it in the meanwhile
  13. obiot

    melonJS es6 module

    took me a few build to properly fix some remaining internal reference to the me namespace, but since build 2839, even more complex example such as the platform one is working when importing the ES6 module, so it seems that it starts to be stable enough to share and play with. here is one, for those interested, that does not have any external dependencies (using the latest dev build) import * as me from ""; // upon device ready me.device.onReady(function () { // Initialize the video. if (!, 562, {scale : "auto"})) { alert("Your browser does not support HTML5 canvas."); return; } // add a gray background layer me.ColorLayer("background", "#202020")); // add a text object in the center of the display me.Text(609, 281, { font: "Arial", size: 160, fillStyle: "#FFFFFF", textBaseline : "middle", textAlign : "center", text : "Hello World !" })); });