Hashasm

Members
  • Content count

    39
  • Joined

  • Last visited

About Hashasm

  • Rank
    Advanced Member
  • Birthday
  1. yesss i got it thanks @Parasyte.. i tried me.viewport.fadeIn(..) but i was getting error as "TypeError: me.viewport is undefined". in documentation i didt get how to use or how to give me.game.viewport.fadeIn() insted of me.viewport.fadeIn(..). I think i am not able to understand the document properly. can you Please suggest me some tips how can i improve myself in better understanding of MelonJS document
  2. i dont have any object but i specified object layer and on clicking on that layer i am loading new map. as shown below image. by using object layer name(map1) i am writing the function as shown below game.redirect = me.Entity.extend({ init: function (x, y, settings) { ..... ....... ....... // set the display to follow our position on both axis // me.game.viewport.follow(this.pos, me.game.viewport.AXIS.BOTH); // ensure the player is updated even when outside of the viewport //this.alwaysUpdate = true; // the main player spritesheet }, onActivateEvent: function () { //register on mouse/touch event me.input.registerPointerEvent("pointerdown", this, this.onSelect.bind(this)); }, // mouse down function onSelect: function (event) { console.log("haiiiiiiii"); // console.log(me.TMXObjectGroup(this)); // me.state.transition("fade", "#FFFFFF", 250); //fade not workin me.levelDirector.loadLevel("temp"); //changing state } }); now map will change but sometime browser screen get blak or map wont change until i press some key from keyboard ,then it will come. Note : some time map will load and appear correctly ..sometimes i wont come untill i press a key
  3. how about using me.LevelEntity for click event. and about idle animations I dont have player in my game its kind of simcity game.
  4. HI , I am trying to load the new map on click of object layer . click event is working and map also loading but some times blank screen will appear until I press any key from key board. the same problem is their in MAP LOADING EXAMPLE :- http://melonjs.github.io/melonJS/examples/tiled_example_loader/ how can I reslove it, and I wana give duration,fade,and color.
  5. hi @obiot you got me wrong ! i solved the drag and clone thing now after clone -drag-drop . while cloning i am creating a new sprite and droping it to my map. now i am trying to write drag and drop functionalities on it(newly created sprite). I think this explains that i am not asking the same topic thank you .. Now can someone help me on this.
  6. OK ..but still i have one doubt even if we use me.DraggableEntity how can i assign it to my sprite . for example game.square = me.DraggableEntity.extend. Here game.square is an object . onClick: function (event) { console.log("clicked!"); // me.collision.check(); camera = new me.Sprite(500, 500, { image: "building_64_64-02", framewidth: 134, frameheight: 134, }); me.pool.register("camera", game.playerdrag); me.game.world.addChild(camera, 10, game.playerdrag); .... .... .... } can i assign like this me.sprite=me.DraggableEntity.extend or any other syntax i have to use
  7. HI can some one suggest me how can i drag the sprite image which I am creating on click of HUD object. i am able to drag the sprites which i have created from the tiled map within object layer by registering them like me.pool.register("mainPlayer", game.playerdrag); But i am not able to drag the sprite even if i am registering in pool. have a look on my code onClick: function (event) { console.log("clicked!"); // me.collision.check(); camera = new me.Sprite(500, 500, { image: "building_64_64-02", framewidth: 134, frameheight: 134, }); me.pool.register("camera", game.playerdrag); me.game.world.addChild(camera, 10, game.playerdrag); .... .... .... }
  8. thank you .i want to modify the level "in-game"
  9. how can i get the json object of tilemap from browser memory. game.resources object is giving me only the path values. please help!!
  10. where can i find the documentation for setter mothd and its syntax
  11. for example instead of using the tilemap json file,if i load the json from a db directly.
  12. instead of loading the tiledmap from resources.js using src, how can i load it directly from database?can someone help me here??
  13. thankyou!!!! in such case the original json file(the map) should be updated after each event. Is that what you are saying?? So even if I try to update the map json using node, to see the effect in the game i will have to load the page again rite??
  14. HI, can some one suggest me how i can dynamically increase the size(increase the floors) of building which created in tiled map editor (exported in JSON format) from game and save or update my JSON. To increase the size of the building from game ,in which layer i have to create my building in titled map. * I wanted to increase floor by floor. *user should give the input in form ,like how many floors he want to add. Can someone help me out how can i achieve this Thank You.
  15. thanks under HUD i am crating me.GUI_OBJECT class