• Content count

  • Joined

  • Last visited

  • Days Won


jpdev last won the day on February 26 2017

jpdev had the most liked content!


About jpdev

  • Rank
    Advanced Member
  • Birthday 02/01/1982

Profile Information

  • Gender
  • Location

Recent Profile Visitors

1,747 profile views
  1. Hi @Deltakosh & @Wingnut thanks for the replys. I found this definition that matches what I experience with buttons across all software (web & desktop): (from My code from the first posting (checking the enterCount) does achieve that. If you agree that the event should fire when "Up" is fired and the cursor is still over the button, and that the enterCount check is the way to go, I'll try and create a pull request on github.
  2. The current solution for marking a thread answered is to edit the first post and add an solved tag or edit the title to "[solved] How many vertices can be imported with Babylon.js?"
  3. Hi, I am using the great babylon gui for my latest project - just some simple buttons for level select so far. I noticed that there is no event that functions exactly as a button "click" event should behave. There are up and down events, but they don't quite hit the mark for the event that should trigger when you "click" a button. Most GUI trigger a button on the "up" event, but only if the cursor is still over the element. (Try it with any button element for example in the post editor of this forum, or any windows button - if you press the mouse button down but only release after moving the mouse outside of the element, it won't trigger) So my fix so far is (pure js): button.onPointerUpObservable.add( function() { if (this.btn._enterCount === 0) { return; } //Do "click" stuff }.bind({btn: button}) ); But this accesses a private variable (_enterCount). So I think there should either be a getter function to access _enterCount or there should be a onPointerClickObservable. Any thoughts?
  4. Zampano, all the tips from rich and nesh108 only cover multiplayer games where there is server that manages everything. What this means is that the Javascript Part (the Phaser Game) that is running in the browser has to connect to a program running on a server and act only as the client. (Such a connection could be made via websocket or continues http request etc.) The server controls the game and only tells the clients what to display and the clients tell the server what the player wants to do. This is much more work than a normal web single player game. There is no way to stop players in single player client side javascript games from cheating.
  5. Help with animations!

    Hi, I think the problem was that you redefine the animations every frame and phaser doesn't like this. Here is your example working: Here is the slightly changed code: I move the animation creation to playerInit (and added a single frame stand animation). Ignore the changes in preloadImageAssets, that was to fit my image files. Edit1: There is another small problem with your code, If you walk in two direction (up & right) at the same time, your code switches the animation from up to right every frame - this way the animation never advances to the next frame. You should restructure getPlayerInput() in a way that manages to only call one at the end. You could create a variable in which you set the animation name during the key checks and then at the end call play with that value. Edit2: I changed the animation settting like I suggested in Edit1.
  6. Move Patron Badge

    +1 Added incentive for Rich to fix it: I will get one when they don't overlap long sentences anymore
  7. Golandy game - Camera follow and see around the player

    The problem now is, that while the world bounds are ok, the tilemap layer (context.floorLayer) only has a width of (in my debugging sesssion) 1280 pixels, while the game (on my browser) has a width of 1920.# That's the reason it cuts of to the right. For testing after creating it I set the width to 1920 (via breakpoint + console) and everything looks fine for that session. I am not sure, why the layer is created with the wrong width - please try to add: context.floorLayer.width = game.width; after creating it, and see if this fixes anything for you.
  8. tilemap not displaying properly

    The first parameter for addTileSetImage must match the name of the tileset in the map file. Here is your example working: (I also edited the level file to not only contain green tiles - I also changed path in the main.js because my server layout isn't the same.)
  9. Golandy game - Camera follow and see around the player

    Hi, layerwidth/layerheight is only the visible (rendered) part of the tilemap - so that's not the way to go to size the word. Layer.resizeWorld() resizes the world to exactly the tilemap size. To make it bigger try this: var layerWidth = context.floorLayer.layer.widthInPixels; var layerHeight = context.floorLayer.layer.heightInPixels;, -layerHeight, layerWidth * 2, layerHeight * 2);
  10. Golandy game - Camera follow and see around the player

    Hi PRSolucoes, Easy fix - this line sets the size of your world: layer.resizeWorld(); But it resizes it to the tilemap layer, this is way the camera is "trapped" within the tilemap. Instead of using the layer to resize your world do it yourself:, -1000, 2000, 2000); The map will still start at 0,0 but the camera will be able to show the space to the left and to the top of the map. Adjust the world size as needed.
  11. Anti-alias when scaled. How to get crisp Pixels?

    I am having good success with these settings so far: = Phaser.ScaleManager.USER_SCALE;, 3); = true; Phaser.Canvas.setImageRenderingCrisp(; This scales the game by 3 and so far everything is scaled pixel perfect and moves one pixel at a time.
  12. SpriteSheet transparent

    The easiest solution would be to edit the sprite sheet in (or any other program that allows to save as .png with a transparent color) and remove the black.
  13. Problems with animation

    Add those two lines below the line that creates the "spider": spider.animations.add("ani1", [1, 2, 3, 4], 10, true);"ani1"); When running the exmaple, the gameboys will now switch color Edit of the linked example: Now switch the different color pictures of the gameboys with spider animation frames. Done Here is the example you can look at: Notice that the example doesn't specify frames, but the spider code above does. You need to specify frames if you have more than one animation in the sprite sheet.
  14. PhaserQuest - Roleplay Mod

    Screenshot looked interesting, but This site can’t be reached refused to connect.