Hashasm

Members
  • Content count

    78
  • Joined

  • Last visited

  1. HI guys, Our City game is progressing well . Now I wanted to animate cars to ply on the roads which is created by the players in the game. After creating the roads i want the car to move on the same road, The roads are created by clicking each tile by the user. The entire road length is saved in a array. I need the cars to move from starting point of my road to end point of road where the user has plotted. can some one tell me what method i can use to achieve this, for now I am trying with https://github.com/Kibo/melonjs-cookbook/tree/master/cookbook/patrol/js patrol method. I am having trouble with my co-ordinates because patrol is in 2d but my game is in isometric , And If I move or pan the screen car was not sticking with my game world rather its taking the browser screen. tried using functions like .toiso(),localToWorld() . But of no luck can some one tell me is their any other way to achieve it or solution for this. Thank you HAPPY GAMING...
  2. hi @01271 you try this it will come this._super(me.Sprite, 'init', [339, 480, settings]); this.addAnimation('normal',[{ name: 0, delay: 600 }, { name: 1, delay: 600 },{name: 2, delay: 600 },{name: 3, delay: 600 },{name: 4, delay: 600 },{name: 5, delay: 600 },{name: 6, delay: 600 },{name: 7, delay: 600 },{name: 8, delay: 600 },{name: 9, delay: 600 }]); this.setCurrentAnimation('normal'); give delay how much you want.
  3. yeah you guys right but if i am using me.Entity the dragging functionalities is not so smooth as in me.DraggableEntity so i am sticking with DraggableEntity only ..
  4. no i am not getting it. i am just changing this.getBounds().height=200; i dont know syntax is correct or not.
  5. hahahaa i didt notice that .. but still no luck txm_pos.to2d(); its not converting properly.
  6. yes we tried to2d also but no luck, i mention in my reply at line no 6. that is :- new me.Vector2d(857,534).to2d(); and i tried new me.Vector2d(this.pos.x,this.pos.y).to2d(); also coming to you code its throwing error console.log('pos:', this.pos.x, this.pos.y); // switch back to world coordinates var txm_pos = me.game.viewport.localToWorld(this.pos.x, this.pos.y); console.log(txm_pos) //giving the pos but for tmx_pos.to2d() its throwing error // switch back to orthogonal coordinates tmx_pos.to2d(); // its throwing error like tmx_pos is not defined console.log('tmx_pos:', tmx_pos.x, tmx_pos.y);
  7. hi guys i got it i am just playing with z index.. i mean increasing the this.pos.z of the selected object so that i will come on top of all other remaining objects .
  8. HI ALL, we tried all functionalites like:- me.game.viewport.localToWorld(this.pos.x, this.pos.y); me.game.viewport.worldToLocal(this.pos.x, this.pos.y); this.clone().toPolygon().toIso(); new me.Vector2d(857,534).to2d() new me.Vector2d(857,534).toIso(); and some math function but still no luck , we also used the position which we got from event like event.gameX ,event.ScreenX & Y etc still we did't get it .. we tried formula mentioned in this forum http://clintbellanger.net/articles/isometric_math/ by using this formula we getting screex and screenY points which is same as the points which we get by event.screenx and event.ScreenY but how can we convert these screen x & y points to tmx X And Y ? QUESTION:-HOW DOES TMX X AND Y POINTS CONVERTING WHILE IT RENDERING OR LOADING INTO OUR MELONJS ? QUESTION DESCRIPTION:- I am creating an object layer in tmx map ,in that i am creating one object by using rectangle tool in the map the x co-oridate is:-3722.00 and the co-ordinate is:-3207.00 but when we loaded into our melonjs and when i console it was giving x =7124 and Y=4422.500000000001 now i am searching where it was converting it .. NOTE: we are doing this convertion for updating of our tmx json file or to save my game progress.
  9. hi guys in abow image i am palcing the name of the building when i drag also it will come along with the building because i am drawing it on top of building by using me.font like this i wana add pin image to my building and it should stick to my building while dragging also ,i tried creating sprite image and adding it to world but it wont stick to my building can someone help me with this .. i am thinking to do as shown in the below image like this
  10. hi all, When ever we make collision check it will take the width and height of the image or object which we are giving . Now can we change width and height of the collision check alone .in my case my image size is 100*100 but while dragging and droping i am making collision check in which it taking 100*100 for check but i wana change it to 200*200 can it be possible . i tried changing the image with and height while dragstart,dragmove and pointerdown ,but still for collision it will take 100*100 only
  11. hey guys good news i found it just make change the pos of z while dragmove then it will not select other object(mutiple objects or entities). thank you having fun with melonjs.
  12. hi guys, can i change the z-index of draggable entity while dragging it .. i am placing few draggable entites and all of them having z-index 10,now when i drag the entity it should come on top of all other draggable entites so i am trying to change the z-index=11 on dragstart but its not affecting what should i do.
  13. i got it now thank you
  14. i am setting this.autoDepth=false; but still z index taking automatically only ...