Jump to content

Search the Community

Showing results for tags 'troubleshooting'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 6 results

  1. A part of my game's post-process render pipeline: Downscale render to 25% size Do some post-processing on the downscaled image Pass both the image before step 1 and the image after step 2 into a GLSL fragment shader with effect.setTextureFromPostProcessOutput(...) Fragment shader outputs the low-res processed image overlaid on top of the original high-res render Problem: The final render is pixelated. I guess the initial downscale made it so the shader doesn't use the higher-res input texture as the "base resolution"? What's going on here? How do I properly set fragment shader input textures of different resolutions in a post-processes?
  2. Hi, I'm a relative noob to javascript and Phaser, and I'm having an issue coding my first proper game. I'm using Phaser version 2.6.2 and the latest version of Chrome browser. I'm asking the user a basic maths question, but when I draw the buttons for the user to click they appear but aren't clickable. Here is the console error: And here is the code I believe to be causing the error: game.add.button(50, 250 + i * 75, "buttons", this.checkAnswer).frame = i; And there is also this bit of code to draw the button mask: this.buttonMask = game.add.graphics(50, 250); this.buttonMask.beginFill(0xffffff); this.buttonMask.drawRect(0, 0, 400, 200); this.buttonMask.endFill(); numberTimer.mask = this.buttonMask; Any help would be appreciated, if you need any extra information to help me I'll gladly provide it. Been staring at this problem for over a week and I just can't figure out what's wrong, I hope it's something simple I'm doing wrong. Thanks
  3. I am working on a basic platforming game and I had a demo working based on the Phaser platformer example on http://phaser.io/ and it works, until I pasted the code into a game state. Now that the game is in a state, it can't find the layer given in the JSON file. It returns "layer is undefined" when I try to use layer.resizeWorld();. Here is the level JSON file and here is the code for the actual game file.
  4. I am trying to test some body data for a game I'm making by modifying the Body Debug example at http://phaser.io/examples/v2/p2-physics/body-debug. I'm getting a TypeError: Undefined is not a function message when I try to run the script, however, and it is happening at the call to game.load.physics. I am using the exact code from the example besides changing the filenames to match my filesystem, and the game.load.image calls work fine, just no body data can be loaded. I just updated my phaser version from GitHub, so it shouldn't be out of date, but I'm not sure if there's some other issue causing this. I doubt it'd be a bug in Phaser. Do you think there is something wrong with the download, or is there something else that'd be causing the problem? The full code for the script and error message stack trace are below (I removed the HTML components, but they were unchanged from the downloadable code for the example: Uncaught TypeError: undefined is not a function (index):23 preload (index):23 d.StateManager.start phaser.min.js:4 d.StateManager.add phaser.min.js:4 d.StateManager.boot phaser.min.js:4 d.Game.boot phaser.min.js:5 d.Game._onBoot phaser.min.js:5 window.onload = function() { var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, update: update, render: render }); function preload() { game.load.image('contra2', 'contra2.png'); game.load.image('bunny', 'bunny.png'); game.load.image('block', 'block.png'); game.load.image('wizball', 'wizball.png'); console.log(game.load.physics); game.load.physics('physicsData', 'sprites.json'); } var contra; var bunny; var block; var wizball; var result = 'Click a body'; function create() { // Enable p2 physics game.physics.startSystem(Phaser.Physics.P2JS); contra = game.add.sprite(100, 200, 'contra2'); bunny = game.add.sprite(550, 200, 'bunny'); block = game.add.sprite(300, 400, 'block'); wizball = game.add.sprite(500, 500, 'wizball'); game.physics.p2.enable([ contra, bunny ], true); game.physics.p2.enable([ block, wizball ], true); // Convex polys contra.body.clearShapes(); contra.body.loadPolygon('physicsData', 'contra2'); bunny.body.clearShapes(); bunny.body.loadPolygon('physicsData', 'bunny'); // Circle wizball.body.setCircle(45); game.input.onDown.add(click, this); console.log(contra.body.debug); console.log(block.body.debug); } function click(pointer) { // You can hitTest against an array of Sprites, an array of Phaser.Physics.P2.Body objects, or don't give anything // in which case it will check every Body in the whole world. var bodies = game.physics.p2.hitTest(pointer.position, [ contra, bunny, block, wizball ]); if (bodies.length === 0) { result = "You didn't click a Body"; } else { result = "You clicked: "; for (var i = 0; i < bodies.length; i++) { // The bodies that come back are p2.Body objects. // The parent property is a Phaser.Physics.P2.Body which has a property called 'sprite' // This relates to the sprites we created earlier. // The 'key' property is just the texture name, which works well for this demo but you probably need something more robust for an actual game. result = result + bodies[i].parent.sprite.key; if (i < bodies.length - 1) { result = result + ', '; } } } } function update() { bunny.body.rotateLeft(2); } function render() { game.debug.text(result, 32, 32); } };
  5. Hey all, I'm having trouble with Phaser 2.1.1 were an animated tilesprite is causing the game to crash through a memory leak of some kind. details are as follows: in preload: /*The spritesheet is huge, especially for one item. I am aware of this*/game.load.spritesheet('playerWaterTrail','media/img/sprites/player/waterTrail.png', 115, 160, 97);in create: /*create the sprite*/this.player.waterTrail = game.add.tileSprite(this.player.x+45, this.player.y-130, 115, 160, 'playerWaterTrail');/*add to the proper layer of the game*/this.baseLayer.add(this.player.waterTrail);/*create and add the animation*/this.player.waterTrail.animations.add('play',null,31,true);/*this causes a massive memory leak somehow over time*/this.player.waterTrail.animations.play('play');this.player.waterTrail.autoScroll(0,-this.WATER_TRAIL_SPEED);this.player.waterTrail.update = function (){ this.x = game.currentActiveState.player.x + 45; this.y = game.currentActiveState.player.y - 130;}.bind(this.player.waterTrail);Any thoughts on what is going on? I'm having trouble tracking it down.
  6. I have been working on a tile-based rogue-like exploration game that is supposed to be very relaxing and peaceful. A lot of it is procedurally generated, and I wanted to procedurally generate the music, too. So I loaded two octaves of notes in the pentatonic scale: this.game.load.audio('notec', ['../wp-content/themes/toolbox/js/assets/music/notec.ogg','../wp-content/themes/toolbox/js/assets/music/notec.mp3']);this.game.load.audio('noted', ['../wp-content/themes/toolbox/js/assets/music/noted.ogg','../wp-content/themes/toolbox/js/assets/music/noted.mp3']);this.game.load.audio('notee', ['../wp-content/themes/toolbox/js/assets/music/notee.ogg','../wp-content/themes/toolbox/js/assets/music/notee.mp3']);this.game.load.audio('noteg', ['../wp-content/themes/toolbox/js/assets/music/noteg.ogg','../wp-content/themes/toolbox/js/assets/music/noteg.mp3']);this.game.load.audio('notea', ['../wp-content/themes/toolbox/js/assets/music/notea.ogg','../wp-content/themes/toolbox/js/assets/music/notea.mp3']);this.game.load.audio('notec2', ['../wp-content/themes/toolbox/js/assets/music/notec2.ogg','../wp-content/themes/toolbox/js/assets/music/notec2.mp3']);this.game.load.audio('noted2', ['../wp-content/themes/toolbox/js/assets/music/noted2.ogg','../wp-content/themes/toolbox/js/assets/music/noted2.mp3']);this.game.load.audio('notee2', ['../wp-content/themes/toolbox/js/assets/music/notee2.ogg','../wp-content/themes/toolbox/js/assets/music/notee2.mp3']);this.game.load.audio('noteg2', ['../wp-content/themes/toolbox/js/assets/music/noteg2.ogg','../wp-content/themes/toolbox/js/assets/music/noteg2.mp3']);this.game.load.audio('notea2', ['../wp-content/themes/toolbox/js/assets/music/notea2.ogg','../wp-content/themes/toolbox/js/assets/music/notea2.mp3']);And then I called a function every time the person took a step: sound_track: function() { // random music generation if ((stepcounter % 2) == 1) { ckey = game.add.audio('notec'); dkey = game.add.audio('noted'); ekey = game.add.audio('notee'); gkey = game.add.audio('noteg'); akey = game.add.audio('notea'); c2key = game.add.audio('notec'); d2key = game.add.audio('noted'); e2key = game.add.audio('notee'); g2key = game.add.audio('noteg'); a2key = game.add.audio('notea'); ckey.volume = .3; dkey.volume = .3; ekey.volume = .3; gkey.volume = .3; akey.volume = .3; c2key.volume = .3; d2key.volume = .3; e2key.volume = .3; g2key.volume = .3; a2key.volume = .3; console.log("this part's working"); var randtime = Math.floor(Math.random()*8)+1; var randmusic = Math.floor(Math.random()*12)+1; if ((randtime == 1) || ((stepcounter % 4) == 1)) { // guaranteed beat console.log(randmusic); if (randmusic == 1 || randmusic == 11) ckey.play(); if (randmusic == 2) dkey.play(); if (randmusic == 3) ekey.play(); if (randmusic == 4) gkey.play(); if (randmusic == 5) akey.play(); if (randmusic == 6) c2key.play(); if (randmusic == 7) d2key.play(); if (randmusic == 8) e2key.play(); if (randmusic == 9) g2key.play(); if (randmusic == 10) a2key.play(); } } },Which seemed to work fine! (Albeit a bit random: I need to write a few more rules, perhaps a bassline, to give the song more structure. But it's already very zen!) Anyway, this works great for the first hundred or so steps, but then the audio starts to get all staticky. Eventually, it stopped playing at all, and I had to reload the window. I thought maybe I could fix this by making the files shorter and more compressed, and I did that, and it seemed to help a bit, but the audio still got pretty corrupted-sounded and eventually stopped all-together. This affects all audio played by the code, even sound effects which have not been played more than a few times, and does not go away if I wait. I am not a programmer, and this is just a side project for me. So it's very possible that I am doing something silly, or stupid, or preposterously round-about. If so, please correct me! I have really enjoyed the experience of coding in Phaser, and it's been a lot of fun, but this kind of bug (which throws no errors in the console!) totally perplexes me, as it falls outside the realm of internal code-logic and into the realm of technical know-how, of which I have none. (If you would like to test the game out, you can find it a http://www.koanoftheday.com/trails, and the password is trails. It's not completely finished, though, so there might be other bugs!) Also, a PS: I have lurked in these forums and used people's advice to solve a number of issues already. This seems like a great place, and you all seem like great people, and I'm excited to finally register and start contributing (even if my first contribution is a request for help!). Thank you all. EDIT: Well, I think I've figured it out! The problem was that I was doing the "ckey = game.add.audio('notec');" stuff (I'm not actually sure what this is called, only how it functions!) every single time the sound effects were called. This was overloading something and making the sound sound horrible. Hopefully somebody else will do the same stupid thing and this post will serve as helpful information to them!
×
×
  • Create New...