Search the Community

Showing results for tags 'problem'.

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 84 results

  1. 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
  2. Download Problem

    Downloading MelonJS (mini) throws up error 800A0404. The case is similair with other versions. I've looked everywhere for a solution but can't find one! am i the first person to have this issue? How do i solve it? please?
  3. CSS and Phaser input problem.

    Hey guys, I have made some scaling of the game via CSS so I can have my game always the proper size in the browser window. However, I lose my onInputDown because for some reason the game container overflows but visually is okay.... here is my CSS styling (visually it looks perfect): html { height: 100%; margin: 0; padding: 0; } body { height: 100%; margin: 0; padding: 0; } #content { height: 100%; } #content > canvas { margin: 0 auto; height: auto !important; width: auto !important; max-height: 100%; max-width: 100%; position: relative; top: 50%; transform: translateY(-50%); } Here is my game init class: import Boot from 'states/Boot'; import Preload from 'states/Preload'; import GameState from 'states/GameState'; import * as Constants from 'data/Constants.js' class Game extends Phaser.Game { constructor() { let height = window.screen.height; let width = window.screen.height / Constants.SIXTEEN_TO_NINE; super(width, height, Phaser.AUTO, 'content', null); this.state.add('Boot', Boot, false); this.state.add('Boot', Preload, false); this.state.add('GameState', GameState, false); this.state.start('Boot'); }; } new Game(); If I don't have any css code - the input works. I believe it is because the game is still bigger than what it visually appears. Has anyone had this issue?
  4. or Hire is playground which doesn't work ok any more or How can I load my .babylon file from dropbox or my server? This code has worked. What is goging on now? I see with F12 new problem XMLHttpRequest cannot load No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '' is therefore not allowed access. But this things has worked before. How can I make this example to work again? Any alternatives? (I also try like this set data (copy/paste from .babylon file) but here is problem with string of data ! I try \" and \' also but no luck.) I would like to make some playground to ask something and I can't meke playground to load .bayblon file. Greetings Ian
  5. 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!
  6. Hello I started playing with phaser, some time ago. But now i wanted to try something new, something like Websocket + phaser. And i stuck :/ So, i want to make multiplayer "Game" but i stuck, i cannot happen that game will be still working in background. It should be working that i m logging at 1st tab and sprite is apearing, than i m logging at 2nd tab and on first another sprite is apearing but on different position. So at the end, at the 1st tab will be 3 sprites, or more, depends how many tabs you will open. Sry for my bad engladno :/ I hope you understood something. My code: Client: var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update }); var player; var cursors; function preload() { game.load.image('med1','client/assets/Unit/medievalUnit_01.png'); } function create() { game.stage.disableVisibilityChange = true; game.physics.startSystem(Phaser.Physics.ARCADE); cursors = game.input.keyboard.createCursorKeys(); game.input.mouse.capture = true; ws.send('NewPlayerJoined',nick); player = game.add.sprite(0,0,'med1'); player.nickname = nick; game.physics.enable(player, Phaser.Physics.ARCADE); ws.onmessage = function(data){ game.add.sprite(Math.floor((Math.random() * 100) + 1),Math.floor((Math.random() * 200) + 1),'med1'); console.log("NewPpl"); }; } function update() { if (cursors.left.isDown) { player.body.velocity.x = -100; }else if (cursors.right.isDown) { player.body.velocity.x = 100; }else{ player.body.velocity.x = 0; } if (cursors.up.isDown) { player.body.velocity.y = -100; }else if (cursors.down.isDown) { player.body.velocity.y = +100; }else{ player.body.velocity.y = 0; } } SERVER: const express = require('express'); const http = require('http'); const url = require('url'); const WebSocket = require('ws'); const app = express(); var players = {}; __dirname = 'E:/WebstormProjects/TestWorkingServer'; app.get('/',function(req, res) { res.sendFile(__dirname + '/client/index.html'); }); app.use('/client',express.static(__dirname + '/client')); const server = http.createServer(app); const wss = new WebSocket.Server({ server }); wss.on('connection', function connection(ws) { console.log("New Connection"); ws.on("message",function incoming(data) { ws.send("sumf"); }); }); server.listen(2000, function listening() { console.log('Listening on %d', server.address().port); });
  7. Hello, I've recently encountered a very strange behavior on a specific PC. I've been testing about 10 Phaser puzzle games, which use various tweens for visualization. I've played the games on quite a few desktop PCs, including a Mac, and more than 10 different mobile devices, Android and iOS. On only 1 of the PCs all games exhibit an aberrant behavior where tweens seem to be running slower than their duration states. I couldn't find anything in the Internet about what could cause this issue. Even a simple alpha tween with a certain duration, no delay and autostart is acting weird. Phaser 2.4.6 is used. The issue is experienced in Chrome, currently the latest version, but I've noticed this behavior in earlier versions in the past months. On Edge everything runs as intended. If anyone has any idea or solution, please share.
  8. sprite.tint white color problem

    Hi! I am new to phaser. I have a sprite called Ground in the group called Platforms var platforms =;platforms.enableBody = true;var ground = platforms.create(0, - 30, 'ledge');The ground sprite has to be white,I use this line of code for that ground.tint = 0xffffff;I don't know why but it does not work with the color white,it works with any other color but not with white. Thanks for help
  9. Canvas not visible on Safari

    Hello, We are making a game with Phaser and works perfect in all the browsers except in Safari (iPad). It's pretty strange becouse the game seems to be running becouse we can hear the music, but the canvas is not displayed... Few seconds later the game is destroyed... We can't use the remote debugging becouse we don't have any Mac to conect the IPad... (Phaser Version: 2.6.2 / IOS version: 9.3.2) Please help!! Thank you
  10. Hello! I'm new to Phaser and HTML5 game development (but not to JS), and have been going through a few free tutorials online. I've already done the mobile toddler's game tutorial, and a simple sidescroller game tutorial, great fun so far! Today I tried to follow an infinite scolling game tutorial (not the same author and not as well written as the first two I followed), but I can't get it to work... The dog falls through the ground on collision with the fleas, and stays stuck down there while the game keeps scrolling. The dog also falls through the ground also after the digging animation... I compared my game.js code to the author's Game.js code, line by line, and didn't see anything missing – I even went so far as to reorder everything the same way she did (the other files were quasi-identical). This is what I found: If I only paste the author's code in place of mine: the game still doesn't work as expected. If I only use the phaser.js v2.1.3 file (from the downloadable source files), instead of the phaser.js v2.6.2 file I use: the game still doesn't work as expected. If I use both the author's Game.js file and phaser.js v2.1.3: the game works! I think that the article must be missing something that can be found in the author's code, because I followed the tutorial exactly. But given that swapping her code for mine still doesn't fix the game, does anyone have any idea what might be causing the player to fall through the ground on collision/overlap? Might it have something to do with gravity, or other physics in Phaser 2.1.3 vs 2.6.2? Thanks in advance!
  11. Hi!, I'm new to Phaser, I just started a day ago and it looked pretty interesting, But lately I've been having some problems with certain sprites that will break the game if I try to add them as an animation (will go into a black screen as soon as starting), and if i try to stop all animations and start the game with no animations, trying to see the sprite at least frozen, the game will just show any other sprite on the list avoiding the 'broken' sprite. I'm using a JsonHash from TexturePacker (the trial version) "walk/07": { "frame": {"x":113,"y":2,"w":38,"h":48}, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":38,"h":48}, "sourceSize": {"w":38,"h":48} }, "walk/08": { "frame": {"x":112,"y":110,"w":39,"h":46}, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":39,"h":46}, "sourceSize": {"w":39,"h":46} }, "batk/01": { "frame": {"x":2,"y":54,"w":39,"h":52}, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":39,"h":52}, "sourceSize": {"w":39,"h":52} }, "batk/02": { "frame": {"x":43,"y":165,"w":33,"h":51}, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":33,"h":51}, "sourceSize": {"w":33,"h":51} }, "batk/03": { "frame": {"x":2,"y":2,"w":64,"h":49}, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":64,"h":49}, "sourceSize": {"w":64,"h":49} }, "batk/04": { "frame": {"x":69,"y":2,"w":41,"h":49}, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":41,"h":49}, "sourceSize": {"w":41,"h":49} }, "batk/05": { "frame": {"x":77,"y":110,"w":32,"h":52}, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":32,"h":52}, "sourceSize": {"w":32,"h":52} }, Here's part of the Json, the sprites that wont work are the "batk/**". And the meta "meta": { "app": "", "version": "1.0", "image": "Kenshin.png", "format": "RGBA8888", "size": {"w":237,"h":218}, "scale": "1", "smartupdate": "$TexturePacker:SmartUpdate:5c2cc8f899f401916073813f8a57c05c:859f44caf8d84d1347ca0147886ae398:b98d3e23e0675afb80a9fc68a5d2d511$" } I remade the Json and the png and still the same sprites won't work. KenshinChar = game.add.sprite(36, - 120, 'Kenshin', 'batk/03'); Tried to start the game with a bg and basically just one of the sprites, without animation and it avoided the sprite showing the first sprite of the Json. Here's the whole png. and these are the ones that won't work. I'm just trying the framework so I borrowed some sprites from a certain ds game. I have absolutely no idea what's happening, sorry if it's something dumb I'm missing.
  12. So I'm not sure if this is a bug or maybe I've just not configured the camera correctly. I have a scene that's the interior of a building and the interior is made of a bunch of room meshes joined together. I have it so that when you click on a room the camera sets that room mesh as its target. If I try to pan the camera(ctrl and mouse drag) after clicking on a room the whole interior pans except for the room that I clicked on which stays in the centre of the screen, separated from the rest of the rooms. Any way to remedy this? I'm using an ArcRotateCamera by the way. Example of what I mean: Click on sphere2 and then pan the camera (ctrl and mouse drag).
  13. Arcade Collision Problem

    Hello! There is this really weird problem that I can't seem to fix. So the problem is when my player's body collides with a particle body, it does some really weird stuff Here is how I'm checking collision: game.physics.arcade.collide(coin.coin, player.coinCol, function(player, coin) { pizza.coins += 1; coin.destroy(); }, null, this); The coins are part of a particle emitter, which gets set off in above the player this.coin = game.add.emitter(totem.x, 100, 0); this.coin.makeParticles('particle'); this.coin.setAll('anchor.x', 0.5); this.coin.setAll('anchor.y', 0.5); this.coin.gravity = 500; this.coin.width = 30; this.coin.height = 10; game.physics.arcade.enable(this.coin); When the coin falls, and the player's body touches it, it works like it should. But when it touches the world boundaries at the same time, it somehow doesn't work. The player is made up of two bodies, one is the totem collision box, which is set at the top of the player, and one that is the coin collision box which covers the whole player. Here is how I'm setting up the coin collision box this.coinCol = game.add.sprite(, game.height); this.coinCol.scale.setTo(5, 6); this.coinCol.anchor.setTo(0.5, 0.5); game.physics.arcade.enable(this.coinCol); update... this.coinCol.x = this.player.x + 100; this.coinCol.y = this.player.y-this.player.height/2; If there is only 1 coin in the scene and it touches the boundaries, it works as expected. I have some ideas about how this might have happened, but I want to hear what other have got to say. Thanks!
  14. Hey guys! I have a export problem in Unity for my architecture visualization(for web). Everytime I export from Unity for BabylonJS I only get 1 picture where are missing some details like the backgroung or the windows. Here you can see what I want to export: Here are the results of the rendering from the BabylonJS exporter for Unity: - - - And here are my current settings in the BabylonJS exporter for Unity: - Can me anyone help with this problem? :c
  15. Hi, I ran across an issue with the setTileIndexCallback method involving it triggerring multiple times. I have a health potion tile in my game and I would like for it to disappear when my player collides with it as well has add 1 to a variable storing the amount of health potions the player has collected. The problem is that the health potion doesn't disappear until my player's sprite actually collides with the health potion tile but the callback function triggers as long as part of my player is touching or inside the 32x32 box around the health potion, which is smaller than 32x32. Therefore, my variable the stores the amount of health potions collected increases infinitely as long as my player is in the 32x32 box but hasn't touched the health potion image. Here's my code relating to this issue: Inside the create function: var healthPotionCounter = 0; map.setTileIndexCallback(9, function(){this.collectHealthPotion(game)}, this); Inside this.collectHealthPotion(game) function: map.putTile(-1, layer1.getTileX(player.x), layer1.getTileY(player.y)); healthPotionCounter += 1; Help is much appreciated! Thank you!
  16. input text/select + cocoonjs

    hi, i'm very new to phaser, i almost finished my first game using it. but i'm facing a problem wrapping my game using cocoonjs . the problem in the input fields, i used a plugin called phaser-input it doesn't have <select></select> option and its unfillable after wrapping . i tried integrating regular html form and it disappear in mobile, you can see my game in : can you please guide me how to make inputs that can be desplayed in mobile after wrapping ... Sorry for the bad english, thank you PS:in game play i reduced the FPS to 25 as the performance in mobile using cocoonjs is bad in 60FPS...
  17. Hi. I have a problem with multiple levels (game states). What can I do when, I don't want to write the same piece of code in each level over and over? I've tried to create a function in separate js file which e.g. will set player sprite, gravity, animations or will create necessary variables etc. And I failed this. Everything what I have got are errors.
  18. Hi, so first thing i'm new to this, 3d modelisation and babylon.js so i'm kinda of a huge noob, but anyway. I started to work on this demo It seems like i get very bad performance from firefox compared to chrome. Do you have an idea why ? you can try the demo on the playground or i hosted the demo on my website : Thx !
  19. Somehow phaser is not loading on IOS, yet loads fine on all else. Don't know what could be causing this, and it happens on multiple projects... What are the differences between IOS and the rest of the devices?
  20. Hello everybody, I have a color rendering problem. When I add a texture to my box ( text ) , the color of the box turns dark . But when I remove the texture color is respected. I would just write a black text on my box and the texture around my box respects the original color With texture (text): Without texture: Good day
  21. Rotating physics problem in P2

    So, I'm developing my frist game right now, and after having lots of troubles choosing the best physics system, I think I'm going with p2, since I need circle collisions. I want to make a sprite, rotating a point, like an orbit, the problem is that when I set the anchor of that sprite, it doesnt rotate the collision body associated to it, it only rotates the image. As you can see in the image, the phaser logo rotates, but the collision body (little debug circle), does not displace itself to the center of the, true);this.sprite.body.setCircle(16);this.sprite.body.velocity.y = 100;this.sprite.body.angularVelocity = +5;this.sprite.anchor.setTo(-0.3,0.5)this.sprite.body.setZeroDamping();
  22. Here is my simple code: <html> <head></head> <body> <canvas id="renderCanvas"></canvas> <script src="jquery-2.1.4.min.js"></script> <script src="babylon.2.2.max.js"></script> <script> var canvas = $("#renderCanvas"); var engine = new BABYLON.Engine(canvas, true); var scene = new BABYLON.Scene(engine); var camera = new BABYLON.ArcRotateCamera("Camera", 1, 2, 10, new BABYLON.Vector3(0, 0, 0), scene); scene.activeCamera.attachControl(camera); engine.runRenderLoop(function () { scene.render(); }); </script> </body></html>When I open that with jQuery and BabylonJS in the same directory, I get this error in Firebug: It works in neither Firefox nor Chrome. WebGL does otherwise work. I can, for example, run and the Three.js examples. I get this same problem on both my Windows and my Mac. Anyone have any idea what's wrong? Here is my Firefox-configuration on Windows:
  23. Hello I have a problem with "enableEdgesRendering" from "createLines". When I activate the function several imaginary line connects to the middle of my ground. When this function is not activate lines are displayed correctly. See attached files, I have print screen. Have a nice day. Germain
  24. Game scaling problem

    Hello everyone! I am just getting in Game development in Phaser. I am trying to create Android application and I am using this: to convert my Phaser code into .apk file. Everything works great and it is the same as in the browser. Also I am scaling the content with devicePixelRatio. However, after the last update(today) of the Android WebView there is a problem with my app... I can't see the whole world and everything is hidden anywhere outside the display. I tried some things, but nothing can fix my problem! I am looking forward for your replies! See the pics before/after: