Giter VIP home page Giter VIP logo

Comments (8)

 avatar commented on May 13, 2024

wow, good catch, and I'll try to reproduce it later and will see what's wrong.
that's funny to see how major bugs can stay "unseen" for a long time anyway, I should have see that myself, but actually never did this this way :)

Thank you, and thank you for your feedback !

from melonjs.

 avatar commented on May 13, 2024

Ok, so I found the issue, since it's not a 5mn correction and since you maybe not use the github 0.9.3 version, here is a workaround that will also work with version 0.9.2 :

onResetEvent: function()
{
me.levelDirector.loadLevel("area01");
me.game.add(this, zIndex) // just put 0 for zIndex if you want to draw stuff in the background, or 999 in the foreground
me.game.sort() // no necessary if you use a very high value (except if you have a tons of object!)
},

tell me it it does the trick for you.

from melonjs.

norb42 avatar norb42 commented on May 13, 2024

update event still not occur :(

When the next release will come ? I have find out some work arround to do what I want so I can perhaps just wait :)

from melonjs.

 avatar commented on May 13, 2024

oh... then it might be a little bit harder to fix :)

just for me to know which kind of workaround are you using ?
on my side when I was saying that i never saw this bug before it's because I never basically mixed them (I don't actually recall I did). I use the update/draw function when I don't use the tile map loader (basically to draw a loading screen), and the "regular" way for all the rest. And If I need to add some overlay information, if not HUD stuff I just create a specific object (that itself by default use the update/draw stuff) and do/draw my stuff from it. And to be honest, the screen object stuff is more like hackish stuff to me, but i haven't yet decided myself what to do exactly with it :)

anyway, if you have a good workaround go ahead with it, the next release won't happen before I finished working on the Tiled map (to get isometric map working, JSON file loading) and add better mouse and touch event. That's more or less my plan for the next release, although I could split this depending if a new version if a major feature or bug correction is required.

i will anyway let this ticket opened until a proper solution is found :)

from melonjs.

norb42 avatar norb42 commented on May 13, 2024

it's actually what I did, I was first thinking of placing some code on the screen object to manage some action (opening of door) but finally I just place the code inside the object itself but I have shown another annoying thing doing that and will open another thread :)

So yes please let it open until it's corrected because I still think for clarity of the code some object must be place on the screen

from melonjs.

norb42 avatar norb42 commented on May 13, 2024

By the way if you can correct this bug and add the following features it can be interesting :)

  • Tiled layer access : we can't have access to the tiled layer from our code (all attribute are private ) I think that can be interesting to be able to change directly tile on the map layer instead of placing new sprite on top, that can also apply to colision layer :)
  • merge TMX map function :
    parameters : this function will take 4 parameters, X, Y, TMXmapName, Z : the Z can be optional
    Goal : place a TMX inside an other TMX
    how to use : something like that :
    me.levelDirector.loadLevel("area01");
    me.levelDirector.mergeWithLevel(10,10,30, "labyrinthechange");

What do you think ?

from melonjs.

 avatar commented on May 13, 2024

For this first point, you can actually already access the layer information :

From your game you can call the following function to get a reference to the required layer :
me.game.currentLevel.getLayerByName(“layerName”);

And from that point you can call all the corresponding function, like getTile, setTile, etc... Where you are right, is that this is not yet documented, but with the code rewrite i've done in this version (on which I still need to work I'll add this in the documentation). In the meantime, you can check the source code and the following objects :
me.TMXLayer (TMXTiledMap.js) that inherits from me.TiledLayer (level.js)
now if you wonder why I have this inheritance here, that's because I kind of made this having in mind the possibility (one day!) to support other format that the TMX one (although this will for sure require more work).

For the second point, I'm not sure I actually really understand the usage for it.
But for sure merging layer "on-the-fly" would need some work to be done, but I rather prefer to focus on other priorities on my side : finish the isometric support (now that isometric maps can be properly displayed in the current build, I need to also manage collision in an isometric way), rewrite the mouse support, and add touch event support.

Also, if you don't mind I'd prefer you to create a new ticket, if you really think this is a needed feature.

from melonjs.

 avatar commented on May 13, 2024

ok this was automatically closed by github (just realized it's automatic when you put "Fixed" before the ticket number), please however come and discuss this on ticket #75, as they are both the same :)

from melonjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.