zakhov

Members
  • Content count

    20
  • Joined

  • Last visited

About zakhov

  • Rank
    Member

Recent Profile Visitors

486 profile views
  1. game.addMedia('assetfile','assetfilenname') So we only use game.addMedia for all asset loading from now on? I used game.addAsset and game.addAudio previously last time I used Panda JS 2.0. I'm going through the latest panda develop version and just trying to wrap my head around some of the changes. Something weird happened when I tried loading m4a/ogg audio files though, I enabled retina/hires and it loads all the image and [email protected] assets correctly, including fonts. But for some reason it's looking for [email protected]/ogg for audio files as well. Is this a bug? game.addMedia('sound/sound_sfx.m4a','sound_fx'); Cheers
  2. Cheers enpu.
  3. Most of the stuff I've done is POC only. I'm quite a newbie to HTML5 games development in general so I'm just experimenting around. Using PandaJS has definitely been a great experience for me as it's a powerful engine whilst being "cleaner" and object-oriented than what I've tried in the past. I haven't published anything on the web yet, but that might change soon or when Panda 2.0 is officially released.
  4. Fader plugin is working for me here in Panda 2.0. Made some alterations to the code though. game.module( 'plugins.fader').body(function() { game.createClass('Fader', { color: 0x000000, speed: 500, fading: false, init: function(settings) { game.merge(this, settings); this.sprite = new game.Graphics(); this.sprite.beginFill(this.color); this.sprite.drawRect(0, 0, game.system.width, game.system.height); }, fadeIn: function(callback) { this.stop(); this.callback = callback; if (this.sprite.alpha === 0) this.sprite.alpha = 1; this.sprite.addTo(this.stage); this.tweenIn = new game.Tween(this.sprite); this.tweenIn.to({ alpha: 0 }, this.speed); this.tweenIn.onComplete(this.fadeComplete.bind(this, true)); this.tweenIn.start(); this.fading = true; }, fadeOut: function(callback) { this.stop(); this.callback = callback; if (this.sprite.alpha === 1) this.sprite.alpha = 0; this.sprite.addTo(this.stage); this.tweenOut = new game.Tween(this.sprite); this.tweenOut.to({ alpha: 1 }, this.speed); this.tweenOut.onComplete(this.fadeComplete.bind(this)); this.tweenOut.start(); this.fading = true; }, fadeComplete: function(remove) { this.fading = false; this.stop(); if (typeof this.callback === 'function') this.callback(); if (remove) this.stage.removeChild(this.sprite); }, stop: function() { if (this.tweenIn) { this.tweenIn.stop(); this.tweenIn = undefined; } if (this.tweenOut) { this.tweenOut.stop(); this.tweenOut = undefined; } }});});The you call it when transitioning to another scene (call it sceneNextScene for example) like this: this.addTimer(1000,function(){ game.system.setScene('sceneNextScene'); });this.fader = new game.Fader({color: 0xffffff, speed: 1000, stage: this.stage});this.fader.fadeOut();
  5. Is Spine support for 2.0+ planned? I'm drafting a few character sketches and was wondering if we could eventually use Spine like in previous versions. Thanks
  6. Same issue with me, on Safari with my iPhone 5C, the game doesn't go to fullscreen(browser nav buttons/address bar shows) and it pushes up the canvas as well in landscape view. Worked fine in iOS8 on iPhone 4S. Perhaps they changed something again.
  7. This is really nice. Would be really useful for a demo that I'm planning to do soon, now I can just use PandaJS and this plugin. Thanks!
  8. Nice work dude! Does this work with Animated sprites and bitmap text as well? EDIT: It seems like with Animation, the sprites flicker. Not working with text on my end so far. But it's working great with normal sprite images!
  9. Depending on how you implemented the sprite to your scene, game.scene.container.removeChild(this.sprite);//replace container with container name you used to add the sprites//orthis.parent.removeChild(this.sprite);
  10. That solved it! Cheers enpu!
  11. Hi enpu, using the same code as above with the latest update freezes the game and triggers an infinite error log in the console - this.parent is not a function I'm not sure exactly but I think the "this.remove();" function might be the culprit.
  12. Really nice work, this will be particularly useful especially when getting input for player's name etc.
  13. Cheers enpu, the code returned no errors and successfully posted a console log that I put to test. But the emitter count still stays and doesn't reduce in the debug. I'm triggering the emitter on an object collision as shown below: collide: function() { this.emitter = new game.Emitter(); this.emitter.textures.push('particle'); this.emitter.angleVar = 120; this.emitter.rate = 60; this.emitter.count = 40; this.emitter.duration = 300; this.emitter.endAlpha = 0; this.emitter.speedVar = 50; this.emitter.startPos.set(this.sprite.position.x + 60, this.sprite.position.y + 70); this.emitter.onComplete = function() { this.remove(); console.log('test remove emitter'); }; this.emitter.addTo(game.scene.objectContainer); game.scene.addEmitter(this.emitter); },Basically I want a particle effect on a collision between two objects, sort of like bullet debris when it hits the wall. Right now it works fine and is showing the effect I want. But I'm still a bit annoyed that the emitter count isn't reducing after completion. It's not affecting performance or the game in any way though, I'm just curious whether the way I'm coding it is the cause. Thanks
  14. I've tried this as well but keep getting Uncaught TypeError: this.emitter.onComplete is not a function. this.emitter = new game.Emitter(); this.emitter.textures.push('particle'); this.emitter.angleVar = 50; this.emitter.rate = 10; this.emitter.count = 5; this.emitter.duration = 100; this.emitter.endAlpha = 0; this.emitter.speedVar = 50; this.emitter.startPos.set(300,300); this.emitter.addTo(game.scene.objectContainer); game.scene.addEmitter(this.emitter); this.emitter.onComplete(function() { // Emitter complete this.remove(); }); I'm using the latest PandaJS dev version(2.0), has there been any changes in how the function is called? Thanks
  15. Thanks for the detailed explanation. It didn't occur to me to look at the engine modules. If there was a rep system, I would've repped you. Cheers