obiot

Members
  • Content count

    109
  • Joined

  • Last visited

About obiot

  • Rank
    Advanced Member
  • Birthday July 20

Contact Methods

  • Website URL
    http://melonjs.org/
  • Twitter
    melonjs

Profile Information

  • Gender
    Male
  • Location
    Singapore

Recent Profile Visitors

819 profile views
  1. wip: PLAYERKILLERS.EXCHANGE

    awesome start ! thank you for sharing it I had troubles though running it under safari (gave me some errors while loading the audio assets), but it was running fine under Chrome and Firefox... I'll add it to our gallery here if you wish, feel free to provide some small descriptions if you want too
  2. Run without rendering (for online game)

    they are a few games here that you can look at for online gaming examples. else for your second question you can set the alwaysUpdate property of your renderables to true, this will keep them "alive" even though they are out of the screen. Be careful thought, that obviously, the more objects you have the more resources it will use.
  3. melonjs zooming and panning

    here it is ! https://github.com/melonjs/melonJS/commit/927755376f3f8d0e0b8edf07a079e442b41c8715
  4. NPC Healthbar with DOM element

    sorry but i'm out of idea myself.... all I can say is that it does not seems an issue on melonJS side, so I'd rather look at your page composition (HTML/CSS) to see if something there is acting weird. did you try to output the actual returned coords in the console, and mornitor the ouput correspondingly to the player position ? at least it would allow eliminate a part of the equation, and to be fixed on either the coordinates returned by melonJS are correct or not. On a side note, you should also use a local vector object in your entity and pass it to the `localToWorld ` function, this will avoid instantiating a vector object at every frame and will make the GC more happy https://github.com/melonjs/melonJS/blob/master/src/renderable/viewport.js#L486
  5. melonjs zooming and panning

    Correct, if the entity the camera is following is constantly moving, calling moveTo won't basically have any effect.... but calling `me.game.viewport.follow(null, null)`; won't work as the method won't assign anything if the give first argument is not an instance of a renderable or a vector object. unfortunately we do not have a unfollow() method (i see it could be usefull though), but as a hack you can manually unassign the private target property by doing `me.game.viewport.target = undefined;` that should do the trick, and you can then move the viewport where you want.
  6. NPC Healthbar with DOM element

    oh I see is it not an issue with you updateLocation method and how it access the minion current position ? I see `this.pos.x` there, so is updateLocation a method of the minion class ?
  7. NPC Healthbar with DOM element

    Looks like you are using an isometric map, so what you are probably missing is to convert back the position to an orthogonal projection (using http://melonjs.github.io/melonJS/docs/me.Vector2d.html#to2d) before calling the WorldToLocal function. So in pseudo code, something like this : 1. localVector = copy(player.pos) 2 . LocalVector.to2d() 3. coords = worldToLocal (LocalVector)
  8. Error during chrome version change

    but it does not makes any sense... if the me.Vector2d class is throwing an exception, it means that somewhere along the line, one the above method is passing a non numerical value to the other one. can you test the following example and report if you are having the same issue ? http://melonjs.github.io/melonJS/examples/shapes/ I'm running Chrome Version 59.0.3071.115 (Official Build) (64-bit) Chrome right now, and the above example is working fine here. Are you using any complex CSS/elements in your page that might affect the pointer position as seen/detected by melonJS ? Also, maybe you could look at sending us a strip down version of your code (including the html page), so that we can reproduce the issue and identify what is wrong?
  9. Swapping and managing containers

    be sure to also call reloadLevel(), with the same options.container value than the one you use initially, this probably needs some improvements but the way it works now is the following (upong calling loadLevel/reloadLevel) : - clean the specifier container (or world container if not specified) - load the new level in the specified container (or world container if not specified) and where the proper default way should definitely be to clean the container in which the level is contained.
  10. shrink map to fit my canvas(viewport)

    another option is to apply the transformation on the world container, or any child container where your map is loaded, see similar discussion here As a reminder, all visible objects are inheriting from the me.Renderable, which means they all have a currentTransform property you can use. Also will follow the parent/child tree.
  11. Swapping and managing containers

    also, today melonJS is not able to properly manage multiple viewport, so unless you want to dig into the code, you can "only" use the main one (me.game.viewport). Note that by following the newly active entity (by calling me.game.viewport.follow(target)), it will automatically "unfollow" the previous one. https://github.com/melonjs/melonJS/blob/master/src/renderable/viewport.js#L225-L241
  12. Download Problem

    nothing is wrong with github, error 800A0404 is when attempting to execute a javascript file, which is obviously not the way of using it as explained later in this same thread....
  13. Download Problem

    l but then choose the boilerplate data directory as destination folder.
  14. Object position in isometric maps

    i just realised we actually never translate an entity position, what i mean is that anentity.pos vector is always in world coordinates, this is all managed through the container update and draw function that translate the whole world/container and display only the visible part. So it means that it should work by only using the 2d() function on the entity pos vector, to find back the original orthogonal position from the TMX file.
  15. Object position in isometric maps

    Yeah there is a typo in my code : txm_pos instead of tmx_pos