• Content Count

  • Joined

  • Last visited

About Anna

  • Rank

Recent Profile Visitors

1089 profile views
  1. I have no idea. I just uploaded the screenshot in the topic.
  2. Hi, I am getting this error ("invalid x,y parameters-not a number) when I left click on the entities or drag around. This is happening only in google chrome version -59.0.3071.86. If we downgrade or upgrade the version it is working fine! The values which we are passing (typeof is a number). So we cdn't figure out why only for a particular version it is showing this error. We have a team using this application and we cannot ask each and everyone to upgrade or downgrade the version. Could someone please help me out here.
  3. Thanks guys!! I tried all mentioned things. but I still couldn't convert my coordinates . so instead of editing the tmx map and then loading the entities i stored them in db and loaded directly in game( there is a small delay though).
  4. so the subtraction will only help in few cases. for example. if the map coordinates are (0,0), then the ortho coordinates will be (mapwidth/2,0). so to get the map value again subtracting mapwidth/2 will help.. it wont happen for all the values!
  5. i tried subtracting the mapwidth from x coordinate and then converting ! still not happening So from wht you said I understand melonjs is converting the map (isometric)coordinates into orthographic coordinates, using the Iso function melonjs is converting when the file loads. But viceversa, i.e converting the orthographic coordinates to isometric is not happening after trying out all these options.. toIso : function () { return this.rotate(Math.PI / 4).scale(Math.SQRT2, Math.SQRT1_2); } i went through the Iso ,rotate functions to do the ortho to iso convertion .. really did not understand how the calculations are happening. I have attached an image along, to explain how wht exactly is happening! my mapwidth is 13200 and height 6600 the first/blue cordinates are the map coordinates and black one's are screen/ortho coordinates!
  6. x and y positions in my JSON(tmx) file: "objects":[{ "height":179, "id":52, "name":"building", "properties": { "frameheight":166, "framewidth":85, "image":"factory1_sprite", "application_name":"abc" }, "propertytypes": { "frameheight":"int", "framewidth":"int", "image":"string" }, "rotation":0, "type":"", "visible":true, "width":189, "x": 3500, "y" : 3500 } ] melonjs code: dragEnd: function (event) { var x, y; if (this.entityselected === true) { if (me.levelDirector.getCurrentLevelId()) { var layer ="ground")[0]; var tile = layer.getTile(event.gameX, event.gameY); if (tile) { if (me.collision.check(this) === false) { this._super(me.DraggableEntity, "dragEnd", [event]); console.log("drag end"); console.log(tile); var pos1 ={}; pos1.x=this.pos.x; pos1.y=this.pos.y; console.log(pos1); var iso = new me.Vector3d(pos1.x,pos1.y).toIso(); console.log(iso); x = this.pos.x; y = this.pos.y; this.isHoldable = false; this.hover = false; this.entityselected = false; } } } } me.collision.check(this); } here the x and y positions i am getting are : {"x" : 6600,"y" :3500}
  7. I tried all those, still the coordinates are different .
  8. Hi, In my isometric tmx file the object positions are :"x":4097 , "y": 3300. But in melonjs when i load the positions I am getting entirely different x and y cordinates. How can i map these both! can someone help me here! I am trying to save the game by editing the tmx json. so the x and y postions I am getting from the UI, when i try to save them in json . its not aligned.the postions are completely different!
  9. Anna

    drag and drop

    i dragged and dropped an HUD element to my tile. The next time when i Drag and drop to the same tile. It is getting attached to the previous image!! How can i avoid this or restrict using the already used to tile!!! Can someone plzz help me here!!!!
  10. Hi, I am using pathfinding.js to find path. once i get the path I need to provide continuous object movement through the path !! Can someone help me here!!!
  11. I wanted to implement pathfinder in my game. I couldnt find any examples in google. Can smeone help me!
  12. @Parasyte.. regarding the in in-memory representation of the map .. so '' will give me all the object entities mentioned in the map. so i was trying to alter in dynamically after an event.. since is return an array. I was trying to push new object to the same array. But its giving me error " TypeError: obj.update is not a function" .. is der any other way to alter it dynamically!!
  13. Hi, I am try to use particles in my code. so i have registered it like this "me.pool.register("droplet", game.dropletParticle, true);" and in my entity.js i have written "game.dropletParticle = me.SpriteObject.extend({ init: function(x, y) { // class constructor this.parent(x, y, me.loader.getImage("droplet")); }, game.startEmitter = function(x, y, count) { // add count particles in the game, all at once! for (var i = 0; i < count; i++) // add the particle in the game, using the mouse coordinates and game layer 5 // use the objects pool for better performance!"droplet", x, y), 5); };" i have mentioned the image in resources.js as well but I am getting the following error ---me.Error: Cannot register object 'droplet', invalid class--- all my other images i have used tmx file. Can someone help me here!!!