Anna

Members
  • Content count

    20
  • Joined

  • Last visited

About Anna

  • Rank
    Member

Recent Profile Visitors

245 profile views
  1. 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!
  2. 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!
  3. 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 = me.game.world.getChildByName("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}
  4. I tried all those, still the coordinates are different .
  5. 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!
  6. 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!!!!
  7. 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!!!
  8. thanku
  9. I wanted to implement pathfinder in my game. I couldnt find any examples in google. Can smeone help me!
  10. Thankyou guys.. I understood !!!!!!!!
  11. @Parasyte.. regarding the in in-memory representation of the map .. so 'me.game.world.children' will give me all the object entities mentioned in the map. so i was trying to alter in dynamically after an event.. since me.game.world.children 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!!
  12. 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! me.game.world.addChild(me.pool.pull("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!!!
  13. got it Do u have any example for panning as well??
  14. Thankyou so much.. Mousewheel event is working for me now . but is there a way to differentiate mouse scroll up and mouse scroll down. for example i am trying to zoom in and zoom out using mouse scroll.
  15. Should i just add the pointer.js file you have updated??? I cdnt find the latest melon.js file in the github .