Search the Community

Showing results for tags 'error'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


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

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 112 results

  1. Hi guys, I was trying to make a group of objects and got the following error: phaser.js:45776 Uncaught TypeError: Cannot read property 'length' of undefined Everything seems to be fine, anyone has a clue why this might be happening? FYI: I'm using Phaser 2.5.0 Thank you for your help.
  2. For a start I would like say hello and give my appreciation to the whole of html5gamedev's amazing and helpful community. I've been lurking here for a while and while you might not have known it, this community has already saved my tons of hours =] . Now to my problem. I litterly JUST started with Phaser and while following ( what I could only imagine to be ) the introductory tutorial , I ran into my very first problem: Right now I am simple trying to load a basic bg image as follows: var game = new Phaser.Game(800, 600, Phaser.AUTO, '', {preload: preload, create:create, update:update}); function preload(){ game.load.images('bg', 'assets/levels/Stage_One_Base.png'); } function create(){} function update(){ } other then that my whole index consist of only including the Phaser framework and this script file. the error I am getting is as follows : Phaser v2.6.2 | Pixi.js | WebGL | WebAudio ♥♥♥ GET http://localhost/workspace/phaserGame/b.png 404 (Not Found) GET http://localhost/workspace/phaserGame/g.png 404 (Not Found) phaser.js:74259 Phaser.Loader - image[b]: error loading asset from URL b.png phaser.js:74259 Phaser.Loader - image[g]: error loading asset from URL g.png This does not make any sense to me. Firstly why is it giving me error about 2 assets, while I am only loading 1. Secondly after a quick google search, for what I have seen usually Phaser's error should contain the proper URL + filename of the img, but this b.png and g.png doesnt make any sense to me ? Am I missing something obvious ? I verifyed the path to the img by typing the full path in the URL ( localhost/workspace/phaserGame/assets/levels/Stage_One_Base.png ) and it loads and displays just fine. Additional info: If this is gonna help, I am running linux mint with xampp as a webserver, installed phaser locally using npm. The image I am trying to load would be used as a background and such is a little big ( 1524x269 ) when I open my webpage all I get is a black screen + the errors, while at the start I was getting the little square ( which while searching google, I found out , that it usually means that my image key-index is correct but phaser can't find the cached image to use ). I am testing it on chromium. And thanks in advance for all of your help =] . P.M. Maybe I should change the title of the post to something more useful/descriptive, any suggestions ?
  3. Hi. I've made a game with Construct 2 and i test it on my own browsers (chrome & firefox / desktop & android) and that was OK and without any bugs and errors. Then 3 days ago i sent an email to Famobi company for sponsorship of my game and they replied me my game have error 502.This is their email text : " Hi AliNj, thanks for your submission but I only get a black screen in Chrome/desktop (latest version). Console error messages Failed to load resource: the server responded with a status of 502 () VM63:100 Uncaught ReferenceError: cr_createRuntime is not defined VM63:1 Application Cache Progress event (1 of 148) VM63:1 Application Cache Progress event (2 of 148) VM63:1 Application Cache Error event: Resource fetch failed (502) undefined:1 Uncaught (in promise) DOMException: Failed to register a ServiceWorker: A bad HTTP response code (502) was received when fetching the script. VM63:93 Uncaught ReferenceError: cr_sizeCanvas is not defined Cheers, Maren " this is the link of my game i uploaded on google drive : Stupid Microbes Can you test my game and send what did you see ? Thanks a lot
  4. Hi everyone ! I beginning Phaser and javascript today, and something wrong was happened. I have this error : main.js:1 Uncaught ReferenceError: phaser is not defined. But I have already import phaser.js (wich contain the Phaser variable) in my index.html, look at my code ! index.html <!DOCTYPE html> <html> <head> <meta charset ="utf-8" /> <title>My first game</title> <script src="js\phaser.js"></script> <style> body{ background: black; } </style> </head> <body> <script src = "js/main.js"></script> </body> </html> main.js var game = new phaser.Game(640,360, Phaser.AUTO); var GameState = { preload : function(){ }, create : function(){ }, update : function(){ }, };
  5. Hello. I'm having trouble importing a scene from blender. The screen is and enless loading loop and I'm getting this error in console: Uncaught TypeError: e.UniversalCamera is not a constructor if (BABYLON.Engine.isSupported()) { var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true); engine.enableOfflineSupport = false; BABYLON.SceneLoader.Load("", "guy.babylon", engine, function (newScene) { var camera = new BABYLON.ArcRotateCamera("ArcRotateCamera", 0, 0, 0, BABYLON.Vector3.Zero(), scene); var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene); scene.clearColor = new BABYLON.Color3(0, 1, 0); camera.setPosition(new BABYLON.Vector3(-10, 50, -50)); camera.attachControl(canvas, false); light.intensity = .5; // Wait for textures and shaders to be ready newScene.executeWhenReady(function () { // Attach camera to canvas inputs newScene.activeCamera.attachControl(canvas); // Once the scene is loaded, just register a render loop to render it engine.runRenderLoop(function() { newScene.render(); }); }); }, function (progress) { // To do: give progress feedback to user }); }
  6. I am having issues making webstorm to work with I have made an empty project, created an html5 (index.html) file. I added the phaser.js and app.ts (basically app.js) to the index.html. I also added the ts files for phaser to work in typescript (phaser.d.ts, pixi.d.ts, and so on). When I try to edit app.ts, it says it cannot find phaser.js but it finds phaser.d.ts fine. When i load it anyways, it cannot find package.json. I know my typescript is working properly because it generates an js file where the ts file is located. How do i make phaser to work with webstorm? I have looked on the part for webstorm section and it only has a little blerp about webstorm is a good choice for phaser. I want to get into game development but I cannot because I have no idea how to make it work. I looked online for videos and their was one but he didn't really show how to add phaser to webstorm properly. Any help on this would be helpful. -Shmelly
  7. So, i made this game and when i try to add to this web there's a black board over my game. What can i do? There's a pic of my problem: Before on this black thing was the phaser's logo, until I delete phaser.png I think this square is created when import the phaser.min.js file
  8. So when I run my game sometimes it works fine, and sometimes I'm getting these errors: WebGL: INVALID_OPERATION: texParameter: no texture bound to GL_TEXTURE_2D WebGL: INVALID_OPERATION: generateMipmap: no texture bound to GL_TEXTURE_2D WebGL: drawElements: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering or is not 'texture complete'. Or the texture is Float or Half Float type with linear filtering while OES_float_linear or OES_half_float_linear extension is not enabled. (this last one one is happening every frame). First of all, I'm using png's for my textures. Also, I didn't think you needed power of 2 textures for web gl, but I made them that just incase and I'm still getting the error. I'm using assetmanager.
  9. I'm using filters as follows: background = game.add.sprite(0, 0); background.width = 800; background.height = 600; filter = game.add.filter('Gray', game.width, game.height); //error here filter.alpha = 0.0; background.filters = [filter];I get: Uncaught TypeError: undefined is not a function Firefox gives a bit more info: TypeError: b.Filter[a] is not a constructor Anyone has any ideas? Thanks!
  10. Can someone help me with the error the playground is throwing. I can run this fine off my own file. The error comes from 234 and 235. Thanks
  11. Hello phaser community, I've been trying for quite some time now to just make a simple map where I can walk over and have a collision when I walk against a rock. As I dont have any errors with the direct code itself ( atleast looks like it) It doesnt seem to give me errors when it tries to load the tiled files : I rewrote my code a decent amouth of times following different guides but i seem to keep on getting this error. hopefully someone can help me Kind regards Files for the whole project : index.html phaser.js WaterfallCave.json WaterfallCave.tmx
  12. Hi! I'm new to Phaser and have had great fun learning the engine. I recently started separating the code for my game into prefab files by extending Phaser.Sprite but I have run in to trouble. When Trying create the movement for the player I have a problem where the player starts moving randomly up or down on the y-scale. When inspecting my Player.prototype.update method in chrome I can see that this.body.velocity.y is NaN. I have no Idea how it got to be NaN pheraps some issue with the gravity? I have tried various fixes but I can't find the bug in my code. I have looked at numerous tutorials and they all look similar to what Im doing. Please help. Below is my code. player.js // Private var leftKey; var rightKey; var jumpKey; var speed = 150; var jumpSpeed = 250; // Constructor function Player (game, x, y) {, game, x, y, Player.key); this.anchor.set(0.5,0.5); game.physics.arcade.enableBody(this); this.body.bounce = 0; this.body.collideWorldBounds = true; this.body.allowGravity = true; leftKey = game.input.keyboard.addKey(Phaser.Keyboard.A); rightKey = game.input.keyboard.addKey(Phaser.Keyboard.D); jumpKey = game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR); game.add.existing(this); } Player.prototype = Object.create(Phaser.Sprite.prototype); Player.prototype.constructor = Player; // Static Player.preload = function(game) { game.load.image(Player.key, "images/block.png"); }; Player.key = "Player"; Player.prototype.update = function() { this.body.velocity.x = 0; if (leftKey.isDown) { this.body.velocity.x = -speed; } else if (rightKey.isDown) { this.body.velocity.x = speed; } if (jumpKey.isDown && (this.body.onFloor() || this.body.touching.down)) { this.body.velocity.y = -jumpSpeed; } }; module.exports = Player; var Player = require('../models/player.js'); var destiny = {}; /* The main game */ destiny.create = function () {"Find out your destiny!"); // World = "#5599CC";, 0, 1000, 500);; = 30; = 200; this.allSprites = {}; // Player this.allSprites.destinyPlayer = new Player(,2000,900); // Camera,Phaser.Camera.FOLLOW_PLATFORMER); }; destiny.update = function() { }; destiny.render = function() {,32,32);,32,128); }; module.exports = destiny; My game is loaded in a series of game states (boot, preload, startscreen, preload, game). I have previously not had any problems with that part but if you want to see that code please ask. Here is the error in chrome. Any help is appreciated.
  13. Hi, I'm not sure if I am allowed to post about this here, but I was wondering if anyone else cannot ever login to see "Your apps" in CocoonJs Launcher on One plus One phone, with Cyanogemod 12.1.1. I just keep getting Unknown error. Am I the only one and is there a way to make it work, because I am sick of uploading my apk every time I build the game.
  14. I am trying desperately to get my own shaders written and have gotten to the point in my research where I understand the process. Now I have gotten to trying to deploy them and actually script them up but I am being restricted from progressing because of this error: syntax error standardTeriableColor.vertex.fx:1:1 syntax error standardTeriableColor.fragment.fx:1:1 BJS - [08:14:19]: Unable to compile effect: babylon.js:3:14445 BJS - [08:14:19]: Vertex shader:./Shaders/standardTeriableColor babylon.js:3:14445 BJS - [08:14:19]: Fragment shader:./Shaders/standardTeriableColor babylon.js:3:14445 BJS - [08:14:19]: Defines: babylon.js:3:14445 BJS - [08:14:19]: Error: ERROR: 0:16: '' : syntax error babylon.js:3:14445 It is saying that the ";" in the first line of the shader is an unexpected character. Im wondering if it is because I saved them through Dreamweaver and perhaps that broke them? I will try rewriting and saving them through notepad and see what happens... here is the script that calls the shader in case I am missing something here! var TERIMAT = new BABYLON.ShaderMaterial("standardTeriableColor", scene, "./Shaders/standardTeriableColor", { attributes: ["position", "uv"], uniforms: ["worldViewProjection"] }); TERIMAT.setTexture("textureSampler", new BABYLON.Texture("./Shaders/standardTeriableColor/beach.jpg", scene)); this._ground.material = TERIMAT; TERIABLE.Region.push(this._ground); Also does a shader have to have reference textures? I mainly want to have just basic rgb (rgba if possible) colors assigned not a texture.
  15. Hello, So I am trying to create a water texture for my scene. I loaded the waterMaterial.js, water.fragment.fx, and the vertex.fragment.fx files with a bump map into my water directory. However, when I try to load my game inside firefox and chrome, the console says "WaterMaterial is not defined". I was following a tutorial and downloaded the example files and their file has the same error. I am using the newest version of Babylon js and I have no idea why this is happening. Do you know why this could be happening? I checked my code and I don't see anything wrong. Maybe there is something I am missing. Thanks for your help in advance! here is the code for the water plane. // Water var waterMesh = BABYLON.Mesh.CreateGround("waterMesh", 512, 512, 32, scene, false); var water = new BABYLON.WaterMaterial("water", scene, new BABYLON.Vector2(512, 512)); water.backFaceCulling = true; water.bumpTexture = new BABYLON.Texture("Water/bump.png", scene); water.windForce = -5; water.waveHeight = 0.2; water.bumpHeight = 0.05; water.waterColor = new BABYLON.Color3(0.047, 0.23, 0.015); water.colorBlendFactor = 0.5; water.addToRenderList(skybox); water.addToRenderList(ground); waterMesh.material = water; // waterMaterial.js var BABYLON = BABYLON || {}; //********************** //water material //******************** (function () { BABYLON.WaterMaterial = function (name, scene, light) { = name; this.TextureBump = "textures/water_river.jpg"; = name; this.light = light; this._scene = scene; scene.materials.push(this); this.bumpTexture = new BABYLON.Texture(this.TextureBump, scene); this.bumpTexture.uScale = 2; this.bumpTexture.vScale = 2; this.bumpTexture.wrapU = BABYLON.Texture.MIRROR_ADDRESSMODE; this.bumpTexture.wrapV = BABYLON.Texture.MIRROR_ADDRESSMODE; this.reflectionTexture = new BABYLON.MirrorTexture("reflection", 512, scene, true); this.refractionTexture = new BABYLON.RenderTargetTexture("refraction", 512, scene, true); this.reflectionTexture.mirrorPlane = new BABYLON.Plane(0, -1, 0, 0); this.refractionTexture.onBeforeRender = function() { BABYLON.clipPlane = new BABYLON.Plane(0, 1, 0, 0); }; this.refractionTexture.onAfterRender = function() { BABYLON.clipPlane = null; }; this.waterColor = new BABYLON.Color3(0.0, 0.3, 0.1); this.waterColorLevel = 0.2; this.fresnelLevel = 1.0; this.reflectionLevel = 0.6; this.refractionLevel = 0.8; this.waveLength = 0.1; this.waveHeight = 0.15; this.waterDirection = new BABYLON.Vector2(1.0, 0); this._time = 0; }; BABYLON.WaterMaterial.prototype = Object.create(BABYLON.Material.prototype); // Properties BABYLON.WaterMaterial.prototype.needAlphaBlending = function () { return false; }; BABYLON.WaterMaterial.prototype.needAlphaTesting = function () { return false; }; // Methods BABYLON.WaterMaterial.prototype.getRenderTargetTextures = function () { var results = []; results.push(this.reflectionTexture); results.push(this.refractionTexture); return results; }; BABYLON.WaterMaterial.prototype.isReady = function (mesh) { var engine = this._scene.getEngine(); if (this.bumpTexture && !this.bumpTexture.isReady) { return false; } this._effect = engine.createEffect("Water/", ["position", "normal", "uv"], ["worldViewProjection", "world", "view", "vLightPosition", "vEyePosition", "waterColor", "vLevels", "waveData", "windMatrix"], ["reflectionSampler", "refractionSampler", "bumpSampler"], ""); if (!this._effect.isReady()) return false; return true; }; BABYLON.WaterMaterial.prototype.bind = function (world, mesh) { this._time += 0.0001 * this._scene.getAnimationRatio(); this._effect.setMatrix("world", world); this._effect.setMatrix("worldViewProjection", world.multiply(this._scene.getTransformMatrix())); this._effect.setVector3("vEyePosition", this._scene.activeCamera.position); this._effect.setVector3("vLightPosition", this.light.position); this._effect.setColor3("waterColor", this.waterColor); this._effect.setFloat4("vLevels", this.waterColorLevel, this.fresnelLevel, this.reflectionLevel, this.refractionLevel); this._effect.setFloat2("waveData", this.waveLength, this.waveHeight); // Textures this._effect.setMatrix("windMatrix", this.bumpTexture.getTextureMatrix().multiply(BABYLON.Matrix.Translation(this.waterDirection.x * this._time, this.waterDirection.y * this._time, 0))); this._effect.setTexture("bumpSampler", this.bumpTexture); this._effect.setTexture("reflectionSampler", this.reflectionTexture); this._effect.setTexture("refractionSampler", this.refractionTexture); }; BABYLON.WaterMaterial.prototype.dispose = function () { if (this.bumpTexture) this.bumpTexture.dispose(); if (this.reflectionTexture) this.reflectionTexture.dispose(); if (this.refractionTexture) this.refractionTexture.dispose();; }; })(); // water shader -- vertex #ifdef GL_ES precision highp float; #endif // Attributes attribute vec3 position; attribute vec3 normal; attribute vec2 uv; // Uniforms uniform vec2 waveData; uniform mat4 windMatrix; uniform mat4 world; uniform mat4 worldViewProjection; // Normal varying vec3 vPositionW; varying vec3 vNormalW; varying vec4 vUV; varying vec2 vBumpUV; void main(void) { vec4 outPosition = worldViewProjection * vec4(position, 1.0); gl_Position = outPosition; vPositionW = vec3(world * vec4(position, 1.0)); vNormalW = normalize(vec3(world * vec4(normal, 0.0))); vUV = outPosition; vec2 bumpTexCoord = vec2(windMatrix * vec4(uv, 0.0, 1.0)); vBumpUV = bumpTexCoord / waveData.x; } // water - fragment -- shader #ifdef GL_ES precision highp float; #endif uniform vec3 vEyePosition; uniform vec4 vLevels; uniform vec3 waterColor; uniform vec2 waveData; // Lights varying vec3 vPositionW; varying vec3 vNormalW; uniform vec3 vLightPosition; // Refs varying vec2 vBumpUV; varying vec4 vUV; uniform sampler2D refractionSampler; uniform sampler2D reflectionSampler; uniform sampler2D bumpSampler; void main(void) { vec3 viewDirectionW = normalize(vEyePosition - vPositionW); // Light vec3 lightVectorW = normalize(vLightPosition - vPositionW); // Wave vec3 bumpNormal = 2.0 * texture2D(bumpSampler, vBumpUV).rgb - 1.0; vec2 perturbation = waveData.y * bumpNormal.rg; // diffuse float ndl = max(0., dot(vNormalW, lightVectorW)); // Specular vec3 angleW = normalize(viewDirectionW + lightVectorW); float specComp = dot(normalize(vNormalW), angleW); specComp = pow(abs(specComp), 256.); // Refraction vec2 texCoords; texCoords.x = vUV.x / vUV.w / 2.0 + 0.5; texCoords.y = vUV.y / vUV.w / 2.0 + 0.5; vec3 refractionColor = texture2D(refractionSampler, texCoords + perturbation).rgb; // Reflection vec3 reflectionColor = texture2D(reflectionSampler, texCoords + perturbation).rgb; // Fresnel float fresnelTerm = dot(viewDirectionW, vNormalW); fresnelTerm = clamp((1.0 - fresnelTerm) * vLevels.y, 0., 1.); // Water color vec3 finalColor = (waterColor * ndl) * vLevels.x + (1.0 - vLevels.x) * (reflectionColor * fresnelTerm * vLevels.z + (1.0 - fresnelTerm) * refractionColor * vLevels.w) + specComp; gl_FragColor = vec4(finalColor, 1.); } }
  16. Hi all. I'm getting the following error when trying to create a Pixi renderer using autoDetectRenderer in Chrome and Firefox: gl.disable is not a function at WebGLRenderer._initContext at new WebGLRenderer at Object.module.exports.Object.assign.autoDetectRenderer I'm using Pixi as part of a much larger, complex framework and haven't tried taking the whole thing apart to see what's causing the problem yet; I was hoping that there might be an easy Pixi-related solution before I get to that... From having a poke around in the Pixi source code I can make the error go away by adding a small tweak: /** * Creates the gl context. * * @private */ WebGLRenderer.prototype._createContext = function () { var gl = this.view.getContext('webgl', this._contextOptions) || this.view.getContext('experimental-webgl', this._contextOptions); = gl; // *** adding the following line makes the error go away *** if (!gl.disable) =; // ********************************************************* if (!gl) { // fail, not able to get a context throw new Error('This browser does not support webGL. Try using the canvas renderer'); } this.glContextId = WebGLRenderer.glContextId++; = this.glContextId; gl.renderer = this; }; While this works, I'm not entirely sure why and obviously I'd rather not rely on hacked-around code in production. So: is there an obvious/known reason this is happening that I can fix? Or, alternatively, will using the above fix break anything important? Unfortunately I can't share a link because the project is pre-alpha still; I might be able to strip out enough to make a useful demo page but it'd be a big undertaking - I'm crossing my fingers and hoping there's something quick and obvious I can fix! Any help much appreciated. Cheers, Tom
  17. Hi all, I'm having a strange issue. I'm working on a project which loads various Babylon files and textures. All works fine when testing locally (I'm using Brackets with live preview) However when I upload to my web server none of the textures are able to load (see attached). All other resources, scripts etc load fine its just the textures that don't. Any clues as to why this error might be occurring? Cheers! Matt
  18. Hello! I've been using phaser and to create a multiplayer game for about 5 days now. However, a weird error is happening: 'players' is a key for a image that I'm using to show other players (it's not the same of your player). Because I'm a newbie with phaser, maybe I'm missing something very basic, but until now I don't have idea of what it is. Here is the start of my code: var game = new Phaser.Game(window.innerWidth, window.innerHeight, Phaser.AUTO, 'kabar', {preload: preload, create: create, update: update});function preload(){ var loadingLabel = game.add.text(window.innerWidth / 2 - 85, window.innerHeight / 2 - 10, 'Loading...', {font: '30px Courier', fill: '#fff'}); game.load.image('player', 'assets/player/player.png'); game.load.image('players', 'assets/player/players.png'); game.load.image('bullet', 'assets/bullet1.png'); game.load.image('space', 'assets/space.gif'); game.load.start(); // I tried without this line too, didn't work }And here are both sockets where I load these images and the error happens: var socket = io(); socket.on('newPlayer', function (data){ var uID = data.uID; players[uID] = new EnemyPlayer(data.oPlayers[uID].id, data.oPlayers[uID].x, data.oPlayers[uID].y, data.oPlayers[uID].angle); players[uID].id = data.oPlayers[uID].id; players[uID] = game.add.sprite(0, 0, 'players'); players[uID].anchor.setTo(0.5, 0.5); game.physics.enable(players[uID], Phaser.Physics.ARCADE); players[uID].body.drag.set(0.2); players[uID].body.maxVelocity.setTo(400, 400); players[uID].body.collideWorldBounds = true; }); socket.on('update', function (data){ playerQuantity = data.playerQuantity if (userID == playerQuantity && userID > 1){ players = data.oPlayers; for (var i = 1; i < playerQuantity; i++){ if (i != userID){ players[i] = new EnemyPlayer(players[i].id, players[i].x, players[i].y, players[i].angle); players[i].id = players[i].id; players[i] = game.add.sprite(players[i].x, players[i].y, 'players'); players[i].anchor.setTo(0.5, 0.5); game.physics.enable(players[i], Phaser.Physics.ARCADE); players[i].body.drag.set(0.2); players[i].body.maxVelocity.setTo(400, 400); players[i].body.collideWorldBounds = true; players[i].position.x = players[i].x; players[i].position.y = players[i].y; players[i].angle = players[i].angle; } } } });(The socket 'New Player' is called for an existing player when a new player joins, while the socket 'Update' is called for the new player to draw all the other players) Could it be an error involving Or is it something that I'm missing?
  19. I was trying to make climbable ladders in my platformer by testing if the player or any npc is in front of a ladder, but my map is scaled with the setScale() method. When I tried this: this.playerHasStairBehind = this.mapa.hasTile( escada.getTileX(this.player.x), escada.getTileY(this.player.y), escada );By the way, escada means ladder or stairs and is a scaled layer imported from the tilemap "mapa". But that code returned this error: In order to solve this, I managed this workaround: this.playerHasStairBehind = this.mapa.hasTile( escada.getTileX(this.player.x/this.mapScale), escada.getTileY(this.player.y/this.mapScale), escada );I hope I've helped someone with this post! And thanks for Phaser, it's an awesome framework!
  20. Hello,,, I've been trying to use SSAO renderingPipeline,,,, and got this ERROR WebGL: INVALID_FRAMEBUFFER_OPERATION: drawElementsInstancedANGLE: attachment has a 0 dimensionbabylon.js:5714 WebGL: INVALID_FRAMEBUFFER_OPERATION: drawElements: attachment has a 0 dimensionbabylon.js:5711 WebGL: INVALID_FRAMEBUFFER_OPERATION: drawElementsInstancedANGLE: attachment has a 0 dimension2(index):1 [GroupMarkerNotSet(!:7CC10008]RENDER WARNING: there is no texture bound to the unit 0(index):1 [GroupMarkerNotSet(!:7CC10008]RENDER WARNING: texture bound to texture unit 1 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering.babylon.js:5457 WebGL: INVALID_FRAMEBUFFER_OPERATION: clear: attachment has a 0 dimensionbabylon.js:5457 WebGL: INVALID_FRAMEBUFFER_OPERATION: clear: attachment has a 0 dimension10babylon.js:5714 WebGL: INVALID_FRAMEBUFFER_OPERATION: drawElements: attachment has a 0 dimension I used code is from SSAO example "CAT" var ssao = new BABYLON.SSAORenderingPipeline('ssaopipeline', scene, 0.75); scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline("ssaopipeline", camera); scene.postProcessRenderPipelineManager.enableEffectInPipeline("ssaopipeline", ssao.SSAOCombineRenderEffect, camera); Any idea >? or same problem here ? NO WORRIES ,, now its working,,,,,,, i've added pipeline while engine wasn't properly initialized
  21. MarvinB


    Hey Guys, I am trying to implement a simple countdown to my game. Unfortunately, Phaser is throwing the following error: Uncaught TypeError: Cannot read property 'apply' of undefined The error occurs in this line in Phaser:[this._i].callback.apply([this._i].callbackContext,[this._i].args); The loop function calls my method once, so it counts down once and then throws the error. I am assuming the callback is not called correctly and therefore the event[this_i].callback is undefined. This is my code: ....... MMM.thisCountDown[id] = countdown; MMM.timerText[id] =, 0, countdown, style); MMM.timerText[id].anchor.set(0.5); MMM.timerText[id].x = Math.floor(textbox.x+2); MMM.timerText[id].y = Math.floor(textbox.y+2); MMM.timerEvent[id] =, this.updateTimer(id)); MMM.backgroundobjects.add(textbox); } updateTimer(id) { MMM.thisCountDown[id] -= 1000; if(MMM.thisCountDown[id] === 0) { //to remove loop event[id]); MMM.timerText[id].setText("EXP"); } else { MMM.timerText[id].setText(MMM.thisCountDown[id]); } }
  22. Hi, I'm having trouble with TypeScript when trying to create a custom preloader function/graphic does anybody know a solution please? thanks j class Main { // onFileComplete can't find this function myLoadUpdate() { console.log("myLoadUpdate"); } preload () {"star", "assets/star.png");, this); // => Uncaught Error: Phaser.Signal: listener is a required param of add() and should be a Function. }}
  23. I'm making a game where a function creates a group of "fish" with tweening, and the tween calls another function on completion to create a new tween with new parameters, and so on. When the player's character collides with the fish, I want them to reset, and swim using a new tween. All the code works except that the tween that was in action prior to collision isn't destroyed by .reset function, and most likely is the reason why the fish are jumping around the screen. Here it is: How do I address or stop a tween when I can reference the object it was applied to? I tried creating a tween manager and added all tweens to it (inside a state's declaration) but keep getting errors (in game.js state file) An example on how to solve this would be nice.
  24. I recently came across this warning, while trying to pack my images into a single texture atlas. I have prepared the atlas with TexturePacker using JSON Hash. For the purpose of the demo I have created a texture with 2 images inside. I have set the texture size to power of 2. The content of the JSON file is: {"frames": {"cat.png":{"frame": {"x":2,"y":68,"w":50,"h":50},"rotated": false,"trimmed": false,"spriteSourceSize": {"x":0,"y":0,"w":50,"h":50},"sourceSize": {"w":50,"h":50},"pivot": {"x":0.5,"y":0.5}},"dog.png":{"frame": {"x":2,"y":2,"w":80,"h":64},"rotated": false,"trimmed": false,"spriteSourceSize": {"x":0,"y":0,"w":80,"h":64},"sourceSize": {"w":80,"h":64},"pivot": {"x":0.5,"y":0.5}}},"meta": {"app": "","version": "1.0","image": "gameContent.png","format": "RGBA8888","size": {"w":128,"h":128},"scale": "1","smartupdate": "$TexturePacker:SmartUpdate:4d5d08212283de860125419268743cc3:0b7ce17362320bea73869f2c1a9da2bb:e88dd6268be3835132a863977762ea7c$"}}In my pre-loader I am loading the atlas using: this.load.atlas('gameContent', 'assets/images/test/gameContent.png', 'assets/images/test/gameContent.json');In my create function, I am loading the cat only: =, 0, 'gameContent', 'cat.png');Upon startup I am seeing this warning in the console. Cannot set frameName: cat.png And instead of loading only the cat from the atlas, it loads the hole gameContent.png. Am I missing something here? Thanks
  25. Hello folks, after nearly over an hour of debug action, I found something strange. I create an object out of some smaller objects using merge. After that, I keep one "original" in background with "isVisible = false". Then, if the settings change, I throw everything away and copy this "original". Set material, size, etc... Then I create instances of this. But I always had an error within babylon while copy. The first time it works as expected. But the second time I use copy with this "original" object, I have this error: (Line 27524: CANNOT SET .references OF UNDEFINED #ERROR) for (var kind in this._vertexBuffers) { if (numOfMeshes === 1) { this._vertexBuffers[kind].create(); } this._vertexBuffers[kind]._buffer.references = numOfMeshes; <==== CANNOT SET .references OF UNDEFINED #ERROR if (kind === BABYLON.VertexBuffer.PositionKind) { mesh._resetPointsArrayCache(); var extend = BABYLON.Tools.ExtractMinAndMax(this._vertexBuffers[kind].getData(), 0, this._totalVertices); mesh._boundingInfo = new BABYLON.BoundingInfo(extend.minimum, extend.maximum); mesh._createGlobalSubMesh(); //bounding info was just created again, world matrix should be applied again. mesh._updateBoundingInfo(); }}I noticed, that after copy, in Mesh._geometry._meshes a mesh had been added. This happend in the new copy as well as in the original one. That's the reason the second round it has "numOfMeshes = 2" and runs into this error. I have no idea why this happens or why the orignial mesh is affected by copy function? I ended up with this (ugly) workaround: function getBarType2() { var Clone = window.BarType2.clone("Pfosten Typ 2"); window.BarType2._geometry._meshes.pop(); Clone.isVisible = true; return Clone;}With this, it works as expected! Can anyone explain what happens here? Have a nice day Kevin