Jump to content

Search the Community

Showing results for tags 'chain'.

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

  1. Shaders are still new to me, so this might be a silly question: Is it possible to chain, or merge shaders? I've got a PBRMaterial which uses the ColorCurves, and a custom shader that generates a texture. I'd love to be able to be able to combine or chain them, so I can have both effects. My initial thought was: 'grab the PBRMaterial and Shader from github, and hack in the properties/functions from my custom shader'. But those files have ~2000 lines of code in them, so if anyone knows an easier approach I'd be grateful. Pseudo code, because one can never be too clear What I've got: ... var mesh = new Mesh(); var materialA = new BABYLON.PBRMaterial("pbrMat", scene); var curve = new BABYLON.ColorCurves(); curve.GlobalHue = 250; materialA.cameraColorCurves = curve; var materialB = new BABYLON.ShaderMaterial("otherMat", scene, "./assets/shaders/otherMat", { attributes: ["position", "uv"], uniforms: ["worldViewProjection", "attribute"] }); materialB.setFloat("attribute", someVar); mesh.material = materialA; // or materialB.. but not both ... What I'd want: var mesh = new Mesh(); var materialA = new BABYLON.PBRMaterial("pbrMat", scene); var materialB = new BABYLON.ShaderMaterial("otherMath", scene, "./assets/shaders/specialMat"); mesh.material.Add([materialA, materialB]); // or mesh.material = materialA.chain(materialB); Thanks for your time!
  2. Not made by me http://www.rainingchain.com A free to play, no pay to win, HTML5 MMORPG built from basically scratch(w/pixijs and a few other components). "a unique 4th wall breaking, open world, rpg" "rc", the creator is on often and he also makes html5 game programming tutorials so be sure to check out his youtube channel. Permission to post this was granted by the creator.
  3. I have been trying to set up a chain of tweens for hours, without results. This is what I want to accomplish: Target is a group, located above the world Tween 1 Arrive: group comes down into x:48, y:96, then Tween 2 Swing: group starts moving back and forth (yoyo) between initial x value and given x value. Tween 3 Creep: In Tween2's onLoop.add a tween is called to move the group in y axis When stage ends, the group must go back its initial position, and its children sprites recreated, so in a restart function I stop Swing tween and to its onComplete add: Tween 4 Go back: group goes back to y, a large negative number which hides it again, on its onComplete I add a call to the function which will create Arrive, Swing and Creep tweens. The problem I'm facing is that in restart, the Swing tween doesn't seem to be stopping even though I call .stop() upon it and everything seems to be executing out of order. Here's the code: Tweens for aliens arriving, swinging and inching downward: //Aliens arrive! this.aliens.x = 96; this.movDat.ay = -(this.world.height/2); this.aliens.y = this.movDat.ay; this.movDat.aliensSwing = new Phaser.Tween(this.aliens,this,this.tweens); this.movDat.aliensSwing.to({x:256},2000,Phaser.Easing.Linear.None,false,0,-1,true); this.movDat.aliensSwing.onLoop.add(function(){ this.movDat.ay+=10; this.add.tween(this.aliens).to({y:this.movDat.ay},2000,Phaser.Easing.Linear.None,true,0); console.log('swung!! moving to y:'+this.movDat.ay); }, this); this.movDat.aliensArrive = new Phaser.Tween(this.aliens,this,this.tweens); this.movDat.aliensArrive.to({x:96, y:48},1000,Phaser.Easing.Cubic.Out,false); this.movDat.aliensArrive.onComplete.addOnce(function(){ console.log('arrived!! swinging from x:'+this.aliens.x+' y:'+this.aliens.y); this.movDat.ay=48; this.movDat.aliensSwing.start(); },this); this.movDat.aliensArrive.start(); Code in level restart function to tween aliens offscreen, and call the fn with code above: console.log('aliens going back...'); this.movDat.aliensSwing.stop(true); this.movDat.aliensSwing.onComplete.addOnce(function(){ this.movDat.aliensGoBack = new Phaser.Tween(this.aliens,this,this.tweens); this.movDat.aliensGoBack.to({y:-400},1000,Phaser.Easing.Linear.None,false);console.log('no more swinging...'+this.movDat.aliensSwing.isRunning); this.movDat.aliensGoBack.onComplete.addOnce(function(){console.log('aliens gone back'); this.aliens.removeAll(); this.createAliens();},this); this.movDat.aliensGoBack.start(); },this); I've had to already shelve another game because I haven't been able to understand the tween system. Any help is appreciated.
  4. Hi all, I want to do something simple, tell a Phaser.Timer to: repeat 10 times in speed A, wait A seconds then repeat 3 times in speed B, wait B seconds then repeat X times in speed C wait C seconds etc... Is there a simple way of doing that? thanks! Lior
  5. Hello everyone, Im trying to develop a snake game like Arrow. I want to know which physics motor seems more appropriate. Also could anyone enlighten me on how to make the snake effect. Thank you!
  6. When I create a repeating tween that yoyos with : var tween = game.add.tween(sprite).to({y: sprite.y+100}, 1000, Phaser.Easing.Linear.None, true, 0, 9999, true);it restarts beautifully when I leave the browser and return. But when I create a chained tween that loops, like : var tween = game.add.tween(sprite).to({y: sprite.y+100}, 1000, Phaser.Easing.Linear.None, true, 0, 0, false);tween.to({y: sprite.y}, move.time, Phaser.Easing.Linear.None, true, 0, 0, false);tween.loop();then the tween is stopped and doesn't always restart when I return to the browser (but sometimes it does, after a while!). Is there a reason for this, or is this a bug? Any way to make this work? UPDATE It seems the autostart of the second chained tween causes this behaviour. When I only set autostart on the first tween, the tween is being restarted when I return to the browser.
  7. I got a tiny problem with chained tweens, i hope anybody can help me: var tween = game.add.tween(mySprite).to({someoptions}, 1000, Phaser.Easing.Linear.None) .to({someoptions}, 1000, Phaser.Easing.Linear.None) .to({someoptions}, 1000, Phaser.Easing.Linear.None) .start();Now what i want to do is to completely stop the whole chain while it runs, and restart it from the beginning. I did this with the following code: game.tweens.removeAll();(game is the Phaser instance, of course) The tween gets stopped indeed and the sprite does not move anymore - but when i create a new tween chain right after "removeAll" it does not start immediately. Instead, the sprite stands still for a while (as if the other tween chain would still run in the background but with no visible effect) and the new tween chain runs smoothly after that time. I hope my explanation was understandable
×
×
  • Create New...