Search the Community

Showing results for tags 'bug'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser
    • Pixi.js
    • Babylon.js
    • Panda.js
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 146 results

  1. Hello, i created a litle game, based on the car demo in the playground, Now i have noticed that when i click with the mouse (left, middle, right) the car bounce a litle for and then back. also when the key is released. I have created an video: Have a look on the console. I dont think this is not an problem with my game logic, more with the canvas. Like you drag & drop the frame. Has anyone an similar problem or a fix for me ? I dont know what to do.
  2. Physics bug

    Box2D always calls contact callback twice. Here's an example: Ship with collision category 2 (ship at left) calls contact callback once while ship with collision category 1 (default) calls it twice. I've been trying to fix this for weeks but couldn't find any solution in web, i really need you guys to help me. function create() { game.physics.startSystem(Phaser.Physics.BOX2D); game.stage.backgroundColor = '#2d2d2d'; // User-controlled ship ship1 = game.add.sprite(250, 300, 'ship'); game.physics.box2d.enable(ship1); ship1.body.setCircle(14); // Ship with collision category 2 (triggers contact callback only once, it shouldn't even trigger it) ship2 = game.add.sprite(200, 200, 'ship'); game.physics.box2d.enable(ship2); ship2.body.setCircle(14); ship2.body.setCollisionCategory(2); // Ship with collision category 1 *default, i guess* (triggers contact callback TWICE) ship3 = game.add.sprite(300, 200, 'ship'); game.physics.box2d.enable(ship3); ship3.body.setCircle(14); game.physics.box2d.setBoundsToWorld(true, true, true, true, false); ship1.body.setCategoryContactCallback(1, function(b1,b2,f1,f2,begin){ if (begin){ total += 1; hitText.text = 'Contact callback called '+total+' times'; console.log("CONTACT: ", b2) } }, this); cursors = game.input.keyboard.createCursorKeys(); game.add.text(5, 5, 'Use arrow keys to move.', { fill: '#ffffff', font: '14pt Arial' }); total = 0; hitText = game.add.text(5, 30, 'Contact callback called 0 times', { fill: '#ffffff', font: '14pt Arial' }); } function update() { if (cursors.left.isDown) { ship1.body.rotateLeft(300); } else if (cursors.right.isDown) { ship1.body.rotateRight(300); } else { ship1.body.setZeroRotation(); } if (cursors.up.isDown) { ship1.body.thrust(300); } else if (cursors.down.isDown) { ship1.body.reverse(300); } } function render() { game.debug.box2dWorld(); }
  3. So I'm getting these weird collision glitches, where I get knocked back randomly. This only seems to happen when I set my sprite's body's width to 8, as opposed to the sprite's width of 16. I'm using Arcade physics, if that makes a difference.
  4. Editor bug with Editor camera

    When I've tried to load .babylon model to the editor, I've receive a message: "ERROR: Cannot insert node with id=EditorCamera (text: EditorCamera) because another node with the same id already exists." Then I've checked the .babylon file but haven't found any object with id "EditorCamera" office.babylon
  5. Hello, everyone. I am using an SVG file to render resolution independent textures. My device has a pixel ratio of 3, and so I set the PIXI resolution to 3 for a crisp display. My SVG texture becomes weirdly pixelated if the canvas it is rendered to is too large. This only happens when using the WebGL renderer. I have two comparison pictures: First one crisp (Canvas), second one pixelated (WebGL). The size of the texture is 1528x1528 and my screen resolution is 1920x1080.
  6. Hi There is bug when BABYLON.GUI buttons that has been created with custom viewport on camera: buttons can be clicked even if mouse is out of button playground:
  7. Can anybody explain me why pointer event (mouse and touch events) does not work in Edge browser ? It Works well with Chrome FireFox Opera! What is difference? Is there any better way to handle (mouse and touch events) in all browser same? You can try and see difference between Edge and Chrome/Fierefox/Opera in this example/game. (here I use hand.min.js) Is there any better alternative of hand.min.js ??? Is there any bug in Edge browser or BabylonJS's hand.js? Edge problem: When I release any of WSAD key it has longer delay only in Edge (Windows) Browser. Is there any batter way to handle (mouse/touch evnets) with javascript? greetings Ian
  8. Hello, Please see the PG:
  9. Hi there, I found this issue when loading a .babylon file with the SceneLoader. After the scene loaded, I found the 'scene.textures' array gets twice length than it should be, and each texture has a duplicated/clone one stays in the array. I think the problem comes from the 'StandardMaterial.Parse' logic, see the test PG: The material json has only has 1 texture, (diffuse Texture), but the 'Texture.Parse' had been called twice, one is for 'diffuseTexture', and the other is for '_diffuseTexture', see the 'SerializationHelper.Parse' definition.
  10. Hi, I've switched from BJS 3-beta to BJS-3 final and now get this error: Error status: 404 - Unable to load src/Shaders/ShadersInclude/shadowsVertexDeclaration.fx What's causing it?
  11. Hello Everyone! I´m testing and choosing a javascript engine to create a game, and I found something weird in Phaser which I can´t fix it. I made a little game just to test how the framework works. I´ve created a sprite, a weapon and a group of enemy. On the collision event between weapon and enemy group the behavior seems weird or bug. The collision event is called, but seems a delay, sometimes work, sometimes no. I don´t know what is happening. Can someone help and tell what is wrong on the code? Here is a link with game running: Sorry for identation on snippet, here on my editor seems all idents aligned. Sorry for var names in portuguese too Thanks var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render: render }); function preload() { //game.load.crossOrigin = 'anonymous'; // 37x45 is the size of each frame // There are 18 frames in the PNG - you can leave this value blank if the frames fill up the entire PNG, but in this case there are some // blank frames at the end, so we tell the loader how many to load game.load.spritesheet('president', 'img/temer2.png', 340, 500, 6); game.load.spritesheet('petista', 'img/petista.png', 272, 460, 2); game.load.image('bullet', 'img/bullet.png'); game.load.image('background', 'img/congresso2.jpg'); // Firefox doesn't support mp3 files, so use ogg'shoot', ['sounds/shoot.mp3']); } var temer; var weapon; var shoot_sound; var background; var petistas; function create() { cursors = this.input.keyboard.createCursorKeys(); fireButton = this.input.keyboard.addKey(Phaser.KeyCode.SPACEBAR); shoot_sound ='shoot'); background = game.add.image(0, 0, 'background'); petistas =; // create group petistas.enableBody = true; petistas.physicsBodyType = Phaser.Physics.ARCADE; petistas.setAll('outOfBoundsKill', true); petistas.setAll('checkWorldBounds', true); petistas.setAll('anchor.x', 0.5); petistas.setAll('anchor.y', 0.5); // center the picture in the world background.alignIn(, Phaser.CENTER); initTemer(); initWeapon(); createPetistas(); } function update() { if (game.input.keyboard.isDown(Phaser.Keyboard.LEFT)) { temer.x -= 4;'walk', 6, true); if(temer.scale.x == 0.3) { temer.scale.x = -0.3; weapon.trackSprite(temer, -60, -18); weapon.fireAngle = 180; } } else if (game.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) { temer.x += 4;'walk', 6, true); if(temer.scale.x == -0.3) { temer.scale.x = 0.3; weapon.trackSprite(temer, 60, -18); weapon.fireAngle = 0; } } else if (game.input.keyboard.isDown(Phaser.Keyboard.UP)) { temer.y -= 4;'walk', 6, true); } else if (game.input.keyboard.isDown(Phaser.Keyboard.DOWN)) { temer.y += 4;'walk', 6, true); } else temer.animations.stop('walk', true); if (fireButton.isDown) {;; } } function render() { //game.debug.spriteInfo(temer, 20, 32); /*for (var i = 0; i < petistas.length; i++) { game.debug.body(petistas.children[i]); }*/ weapon.debug(); } function initTemer() { temer = game.add.sprite(,, 'president'); temer.anchor.setTo(0.5, 0.5); temer.scale.setTo(0.3, 0.3); temer.animations.add('walk'); } function initWeapon() { // Creates 1 single bullet, using the 'bullet' graphic weapon = game.add.weapon(30, 'bullet'); // The bullet will be automatically killed when it leaves the world bounds weapon.bulletKillType = Phaser.Weapon.KILL_WORLD_BOUNDS; // The speed at which the bullet is fired weapon.bulletSpeed = 400; // Speed-up the rate of fire, allowing them to shoot 1 bullet every 60ms weapon.fireRate = 60; weapon.bulletAngleOffset = 0; weapon.fireAngle = 0; // Tell the Weapon to track the 'player' Sprite, offset by 14px horizontally, 0 vertically weapon.trackSprite(temer, 60, -18); } function createPetistas() { var petista_height = 184; var y_point =; if(game.height - petista_height > y_point) y_point = game.height - petista_height; var petista = petistas.create(0, y_point, 'petista'); petista.scale.setTo(0.4, 0.4); petista.animations.add('walk');'walk', 2, true); game.add.tween(petista).to({ x: game.width + (1600 + petista.x) }, 20000, Phaser.Easing.Linear.None, true); game.physics.enable(petista, Phaser.Physics.ARCADE); // add colision event game.physics.arcade.overlap(weapon.bullets, petistas, collisionHandlerPetista, null, this); var MIN_ENEMY_SPACING = 300; var MAX_ENEMY_SPACING = 3000;, MAX_ENEMY_SPACING), createPetistas); } function collisionHandlerPetista(bullet, petista) { petista.kill(); bullet.kill(); console.log('colision detected'); }
  12. Hey guys I'm making a platformer and I've managed to get my character running and jumping at the same time... to one side only - the right! I have NO ideia why running and jumping to the left is proving impossible but I'm hoping you can help me out. runKey = game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR); // The running key, in the create method // Fast forward to my update method (...) // Horizontal movement player.body.velocity.x = 0; // Resets our character's horizontal movement. if (cursors.left.isDown) // If the 'left' key on our keyboard is pressed ... { player.scale.x = -1; // ... we horizontally flip our character to face the left ... player.body.velocity.x = -200; // ... we move him to the left ...'walk'); // ... play the 'walk' animation ...'', 0, 1, false, false); // ... and finally play the 'player_walk' sound effect. if (runKey.isDown) // If the 'run' key on our keyboard is being pressed while we are walking to the left... { player.body.velocity.x = -350; // ... we allow our character run to the left. } } else if (cursors.right.isDown) // If the 'right' key on our keyboard is pressed ... { player.scale.x = 1; // ... we horizontally flip our character to face the right ... player.body.velocity.x = 200; // ... we move our character to the right ...'walk'); // ... play the 'walk' animation ...'', 0, 1, false, false); // ... and finally play the 'player_walk' sound effect. if (runKey.isDown) // If the 'run' key on our keyboard is being pressed while we are walking to the right... { player.body.velocity.x = 350; // ... we allow our character run to the right. } } else // If no key on our keyboard is pressed ... {'idle'); // ... play the 'idle' animation ... } // Vertical movement if (cursors.up.isDown && (player.body.blocked.down || player.body.touching.down)) // If the 'up' key on our keyboard is pressed and our character is touching a surface ... { if (runKey.isDown && player.body.velocity.x < 0) { player.body.velocity.x = -350; player.body.velocity.y = -700;'', 0, 1, false, false); jumpCounter = 1; } else if (runKey.isDown && player.body.velocity.x > 0) { player.body.velocity.x = 350; player.body.velocity.y = -700;'', 0, 1, false, false); jumpCounter = 1; } player.body.velocity.y = -700;'', 0, 1, false, false); jumpCounter = 1; } else if (player.body.velocity.y < 0) { if (runKey.isDown && player.body.velocity.x < 0) { player.body.velocity.x = -350;'jump'); player_walk.pause(); } else if (runKey.isDown && player.body.velocity.x > 0) { player.body.velocity.x = 350;'jump'); player_walk.pause(); }'jump'); player_walk.pause(); } else if (player.body.velocity.y >= 0 && !(player.body.blocked.down || player.body.touching.down)) { if (runKey.isDown && player.body.velocity.x < 0) { player.body.velocity.x = -350;'fall'); player_walk.pause(); } else if (runKey.isDown && player.body.velocity.x > 0) { player.body.velocity.x = 350;'fall'); player_walk.pause(); }'fall'); player_walk.pause(); } else { jumpCounter = 0; } I really don't understand what's wrong Thanks in advance!
  13. Context: in my game i got the setup you can see in the image. I got an image larger than the window, so i'm able to displace the image with the window's scroll bar, in the lower part of the image I got a button so it's initially hidden. Problem: When I scroll down to see the button and put the pointer over it, it doesn't work for a few seconds (it doesn't execute input events. No hand cursor), after moving the cursor a little while over the button, it works again. I also checked the variables "visible" and "inputEnabled" in the update() but they are always true, so I suppose Phaser do something else to disable elements which are off-screen, and re-enable them once they are on-screen. Any suggestion would be highly appreciated.
  14. I can't use external video for videoTexture

    Hello! 使用本地视频: 使用外部视频(跨域) 使用外接影像无法正确播放!
  15. Looks like OimoJSPlugin class incorrectly implements IPhysicsEnginePlugin interface. So with Babylon.js 2.5 when I try to enable physics with Oimo.js plugin like this: scene.enablePhysics(new BABYLON.Vector3(0, -9, 0), new BABYLON.OimoJSPlugin()); I get the following TypeScript compilation error: TS2345: Argument of type 'OimoJSPlugin' is not assignable to parameter of type 'IPhysicsEnginePlugin'. Types of property 'updateDistanceJoint' are incompatible. Type '(joint: IMotorEnabledJoint, maxDistance: number, minDistance?: number) => void' is not assignable to type '(joint: DistanceJoint, maxDistance: number, minDistance?: number) => any'. Types of parameters 'joint' and 'joint' are incompatible. Type 'DistanceJoint' is not assignable to type 'IMotorEnabledJoint'. Property 'setMotor' is missing in type 'DistanceJoint'. I'm using babylon.d.ts type definition file from babylonjs npm package.
  16. Possible bug report

    I a having trouble with the interactive elements in the minified version of pixi 4.0 To give me a fake input box i have an input box at the end of my dom that i make focused to take keyboard input so take the value of and place in text container. But the minified version of pixi is stealing the focus from my input box where the unminified version is not.
  17. I have different tiles, each in its own canvas. When I toggle the camera (simultaneous), the tile that our out of the viewport seem to go wrong. This only happens in Firefox. One odd thing that I am doing in my code - and this is part due to the bug - is I am having my my rendering stopped all the time, but whenever a ui action is done (ao the camera toggling) I do a runRenderLoop() (I do this for processor saving, since my frames don't update all the time);
  18. Gamepad Disconnection Problems

    My Phaser.js version: `v2.6.2 "Kore Springs"` Gamepad: generic Logitech Dual Action controller OS: OSX Sierra Browser: Chrome Update: I can confirm that this also occurs with an XBOX 360 controller. Also see @Cyclone112's comments below for more troubleshooting info. I'm adding gamepad support to my current project, and am encountering the following error when disconnecting the gamepad from the USB input: Uncaught TypeError: Cannot read property 'timestamp' of undefined at c.SinglePad.pollStatus (phaser.js:43607) at c.Gamepad.update (phaser.js:43003) at c.Gamepad.reset (phaser.js:43169) at c.Input.reset (phaser.js:37282) at c.Game.gameResumed (phaser.js:36532) at c.Stage.visibilityChange (phaser.js:31966) at HTMLDocument._onChange (phaser.js:31905) This happens regardless of whether or not I register `onDisconnectCallback` to the gamepad. May also be worth mentioning that I encounter the error when disconnecting from this example: If the Github issue tracker would be a more appropriate place for this, I can post there instead. Any recommendations for a workaround would be great. Thanks!
  19. Simple bug in removeChildren function

    Calling removeChirldren on sprite causes reference error because begin is not defined. Function gets beginIndex as parameter but never defines begin variable. Fix is as simple as changing begin to beginIndex. There is open issue on this. My Phaser version is 2.6.2
  20. Alright. I'll cut to the chase. I'm making a simple game about abducting people, and I want the victims to run from the player or "flying saucer". This is what I have setup in the update function (I'm pretty sure the rest is irrelevant, but tell me if you need more): = game.physics.arcade.angleToXY(, -(this.player.x), -(this.player.y)); = game.physics.arcade.velocityFromAngle(, 145,;, 0, false); Now here is the error after getting to the "play" state (Oh and by the way, the game is based off of the state tutorial for phaser, except with a lot of edits and a lose.js file.): Uncaught TypeError: d.setTo is not a function at c.Physics.Arcade.velocityFromAngle (phaser.min.js:23) at Object.update (play.js:94) at c.StateManager.update (phaser.min.js:10) at c.Game.updateLogic (phaser.min.js:12) at c.Game.update (phaser.min.js:12) at c.RequestAnimationFrame.updateRAF (phaser.min.js:18) at window.requestAnimationFrame.forceSetTimeOut._onLoop (phaser.min.js:18) Please help!
  21. I need help. I was following a tutorial online for the Phaser States, and I did everything right (I think), but obviously, I've made some changes myself to fit to what I kind of want. Here is the code: var loadState = { preload: function() { // Load the BG Images (Before so we can have an awesome looking loading screen) game.load.image('redPlanet', '././assets/images/redplanet.png'); game.load.image('spaceBG', '././assets/images/spaceBG.png'); // Preload the one character we need to look awesome! game.load.image('scavenger', '././assets/images/Scavenger.png'); // Add the loading label and the character, so the player doesn't think the game crashed. var background = game.add.sprite(0, 0, 'spaceBG'); background.scale.setTo(0.6); var character = game.add.sprite(80, 150, 'scavenger'); var loadingLabel = game.add.text(0, 0, 'Loading...', {font: '30px Courier', fill: '#fff'}); loadingLabel.alignTo(character, Phaser.RIGHT_CENTER, 16); // Load the Planet Images game.load.image('planet1', '././assets/images/Planet1.png'); game.load.image('planet2', '././assets/images/Planet2.png'); game.load.image('planet3', '././assets/images/Planet3.png'); game.load.image('planet4', '././assets/images/Planet4.png'); game.load.image('planet5', '././assets/images/Planet5.png'); game.load.image('planet6', '././assets/images/Planet6.png'); game.load.image('planet7', '././assets/images/Planet7.png'); game.load.image('planet8', '././assets/images/Planet8.png'); game.load.image('planet9', '././assets/images/Planet9.png'); game.load.image('planet10', '././assets/images/Planet10.png'); game.load.image('planet11', '././assets/images/Planet11.png'); game.load.image('planet12', '././assets/images/Planet12.png'); game.load.image('planet13', '././assets/images/Planet13.png'); game.load.image('planet14', '././assets/images/Planet14.png'); // Load the pause button game.load.image('pauseButton', '././assets/images/pauseButton.png'); } create: function() { game.state.start('menu'); } } And that is not all. Every single one of my state files has an error that says: Expected '}' to match '{' from line 1 and instead saw 'create'. Missing Semi-Colon. Unrecoverable Syntax Error (93% Scanned) Please help me, as this was going to be the way I made my game because I really like how organized states are!
  22. I think I may have stumbled across a rendering bug that occurs when graphic objects are added as children to sprite objects. This code: let graphics =; graphics.lineStyle(2, 0x0000FF, 1); graphics.drawRect(0, 0, 32, 32); let sprite =, center.y); sprite.addChild(graphics);; Results in different dimensions for the sprite in (Safari / Firefox) and Chrome. Chrome reports the sprite's dimensions relative to the graphic object (32x32), however Safari and Firefox both incorrectly render the sprite's dimensions as (1x1) from a call to It causes my tetris pieces to render differently in both browsers. In Safari / Firefox, I am forced to set the rectangle to the dimensions of (1x1) and use the sprite's width and height properties to set the dimensions correctly. However, this breaks the sprite in Chrome. EDIT: It appears the offender is this property: "sprite.texture.frame.width". In Safari it's 1 and in Chrome it's 32.
  23. Hi there, I have a minimap implemented by having a secondary camera in a RenderTargetTexture applied on a plane. In the 2.6 preview version since a change committed on Dec 21st 2016, something has been broken. So when I dispose an object in my scene, the entire plane which holds the minimap (the RenderTargetTexture of a camera) disappears too. This is obviously not the expected behaviour. I traced the problematic commits and they happened to be these: commit 49e419016287753a9720a46114bbc605df69db79 Merge: 55f1083 d0fbbc9 Author: David Catuhe <> Date: Wed Dec 21 12:23:33 2016 -0800 Merge pull request #1622 from haxiomic/UseOpenGLProjectionMatricies Use OpenGL projection matricies over Direct3D for better depth precision To reproduce the problem, please download the attached zip and run index.html. The code has setTimeout that will dispose the sphere. You will see that the minimap disappears too. Then when you modify index.html to reference good-babylon.js instead of bad-babylon.js you will see that when the sphere disappears, the minimap will not disappear. bad-babylon.js is the current preview version built from master, whereas good-babylon.js is from a version before the problematic commit. I hope someone knowledgeable of the changed area of code fix the issue for us.
  24. First off, PIXI is incredibly new to me so the problem might lie in my incompetence. What I did: var localOffset =; console.log(JSON.stringify(localOffset)); mouseData being the input of multiple different mouse events (mousedown, mouseup, rightdown, rightup, mouseover) The rotation of my sprite is set to 0. What happens: The console prints {x:xval, y:yval} where xval changes when moving up/down and yval changes when moving rigth/left. As far as I can tell, everything else seems to work with x increasing towards the right and y increasing towards the bottom of the screen. I can easily work around this but it felt report worthy. Additional stuff that might be of interest: The local position seems to be correctly offsetted by the anchor. What feels wrong to me is that the distance does not take into account the width/height of the actual sprite, only the width/height of the texture being used. This might actually be working as intended but is not what I expected. Have a nice day, - Michael Ok, so it gets weirder (for me). To make sure no rotation data is screwing with me I hardcoded the rotation to different values. Rotation does not seem to influence my results. x and y are not only swapped, the sign of x (value found in y) is also inverted I get the expected values when using a PIXI.Container() instead of a sprite (no xy swap, no inverted sign).
  25. Hallo Community, I have a problem with HandJS on touch devices with Google Chrome 55 or higher. When I try to rotate or zoom or anything else the 3d object, it moves a little bit and then stops. When I make a console log on every pointermove event it get triggered once after the pointerdown event. In my opinion it should get triggered many times, just like the touchmove event does. According to Caniuse, Chrome 55 is the first version which supports the pointer events. I think that chrome might have the pointer events implemented a bit different than IE or Edge, but the Workaround with HandJS does not work anymore because the pointerevents actually exist. So my question would be how to write a workaround? Hopefully you could help me. Sincerely, David