Comments (8)
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.
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.
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.
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.
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.
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.
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.
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)
- Fix code scanning alert - Polynomial regular expression used on uncontrolled data
- Optimize the `arcTo` function to use `gl.LINES` HOT 1
- Cache or optimize triangulation data used for drawing with fill operation
- `textImage2D` does not accept OffscreenCanvas anymore as a pixel source for texture
- optimize matrix operations using Strassen algorithm ? HOT 5
- compressed textures in WebGL HOT 3
- WebGPU renderer
- TypeScript defenition for loader.preload incorrect HOT 6
- [Feature request] More realistic progress based on bytes for loader and preloader
- Texture is never removed from TextureCache
- TextureCache.length can't be decreased HOT 5
- support using SVG path data when creating a Path2D path HOT 1
- this.body is pointing to Dom type when using Typescript Boilerplate HOT 8
- Animation created from atlas: misaligned hitbox HOT 1
- Some of the Github pages examples are broken HOT 3
- Difficulties with UITextButton HOT 6
- Animation broken on WebGL if TextureAtlas has multiple textures HOT 9
- The result of the flip object vibrates
- Hyperlinks to source code within documentation contain absolute path on obiot's PC HOT 4
- withCredentials does not get set in fetch calls HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from melonjs.