All Activity

This stream auto-updates     

  1. Past hour
  2. Nabroski

    Updating A Shader Material Frag Shader

    @AlexB sorry, i have to pass on this one. my sketch https://www.babylonjs-playground.com/#CNE3P8 Babylonjs have a new shader system (or something like wise) you have to bind the uniform to createEffect not createShader somehow. Ask a questions in this forum, i have no idea how to use it. http://doc.babylonjs.com/api/classes/babylon.engine#createshaderprogram http://doc.babylonjs.com/api/classes/babylon.engine#createEffect Good Luck @Sebavan Yeah
  3. andrei.nicolae

    Bring to top container

    Thank you for the quick answer. So if I need a popup in multiple scenes I have to create it in each one, right? I was hoping I could use something like a prefab, which I could show in any scene at any given time.
  4. TakeNewGames

    We Sell HTML5/IOS/Android games (Construct 2)

    Hi, Guys. We have new games for sale 41. Flying Triangle - HTML5 Game + Mobile Version! (Construct 2 / Construct 3 / CAPX) https://codecanyon.net/item/flyingtriangle-html5-game-mobile-version-construct-2-construct-3-capx/22062059 42. Mr Pong - HTML5 Game + Mobile Version! (Construct 2 / Construct 3 / CAPX) https://codecanyon.net/item/mr-pong-html5-game-mobile-version-construct-2-construct-3-capx/22068629 43. Fast Arrow - HTML5 Game + Mobile Version! (Construct 2 / Construct 3 / CAPX) https://codecanyon.net/item/fast-arrow-html5-game-mobile-version-construct-2-construct-3-capx/22095658 Full games list here: https://codecanyon.net/user/gmsdev/portfolio
  5. Buzul

    Video pause problem (Help)

    Hi again everybody...I'm writing here because my new problem about this topic.. I solved my old problem as above.. I need your suggestions for create a play list for videos.. How can i do that with continue from above simple?
  6. I've only copy pasted from the tutorial (altering only the resource locations, which work) and as I reach part 4, the part which uses the refreshBody function, I get the same error. The error looks like this: game.js:42 Uncaught TypeError: platforms.create(...).setScale(...).refreshBody is not a function at initialize.create (game.js:42) at initialize.create (phaser.min.js:1) at initialize.loadComplete (phaser.min.js:1) at initialize.h.emit (phaser.min.js:1) at initialize.processComplete (phaser.min.js:1) at initialize.removeFromQueue (phaser.min.js:1) at initialize.processUpdate (phaser.min.js:1) at Image.data.onload (phaser.min.js:1) I am attaching the source file as well. Just in case, here is my index.html: <!DOCTYPE html> <html> <head> <script src="//cdn.jsdelivr.net/npm/phaser@3.0.0/dist/phaser.min.js"></script> <script src="js/game.js"></script> </head> <body> </body> </html> game.js
  7. rich

    Bring to top container

    If the Container isn't a child of the current Scene, it cannot be positioned in that Scene's display list. Either bring the Scene which owns the Container above the current one, or create the Container in the Scene in which you actually need to position it.
  8. Code looks fine at a cursory glance. What happens if you replace your code with the actual code from the tutorial files?
  9. espace

    how to do this effect ?

    waouw thanks i don't really understand for time how you do but i will read the docs.
  10. Today
  11. RaananW

    Deterministic lockstep issue with high FPS

    Hi @RetekEger, your guess is right. The default values are set for 60fps. You can see the get and setTimeStep functionis of both engines. You can set the timestep to be different and fit your needs: physicsEngine.setTimeStep(1/120) I hope this gets you further!
  12. andrei.nicolae

    Bring to top container

    Hi guys, does anyone know how can I bring in front of all of my scene a container(popup) that was created in a previous scene? Is this possbile? Thanks.
  13. Finished 3 New Tracks for my Royalty Free audio catalogus:
  14. Pixels Commander

    Why glow is not applied to lines?

    So I have similar material on both line and box. And line is missing the glowLayer effect:
  15. This is my first time integrating any outside source into my phaser project, so please bear with me. Also, if there's anything that's unclear (regarding errors), lemme know so I can update this. For the first question, please check my steps below if I imported them right: Navigate into base project directory in a terminal, type in npm i / install "scroll-plugin-of-your-choice-here" Watch a lot of text scroll by (Mostly warnings) Find the folder in the node_modules directory of my project, copy the required file from the dist folder into my folders (this one is called: plugins) Import the required file in JS files that will use it ??? Profit I've tried three so far. This is the first one, heard good things about it: http://jdnichollsc.github.io/Phaser-Kinetic-Scrolling-Plugin/ I couldn't even get past step 4 tho. Assuming it doesn't need importing, it appears my project structure is different enough (more on this later), that I'm not entirely sure where to put the "load plug-in code"; putting it in my game.js (the JS file that is called by the HTML file) gets me a "Cannot read property 'plugins' of undefined". Putting it in the 'create' function of my boot.js (the first Phaser state started) gets me a "Cannot set property 'game' of undefined". That pretty much ends it. Also, I read it uses the camera, so I'm not sure if it was the way to go anyway. I have two things to scroll: the toolbar, and map itself. The second one is this: https://github.com/mattcolman/phaser-list-view It appeared to have clearer instructions than the first one, regarding import and usage. Unfortunately, there is some sort of 'Promise' code in the source, which to my limited experience is only used in async functions. This one fails outright, and throws an error the moment the game is loaded: "Cannot read property 'Promise' of undefined" The third and final one is this: https://github.com/trueicecold/phaser-scrollable It looks to be the simplest one of all, and is based on the amazing work of the first one, but like the first one didn't tell me about whether or not I need to copy-paste the plugin anywhere and/or import it anywhere I need to use it. Just copying the code into my mapEditor.js (the final state loaded, after boot.js - the "game" itself), results in the following error: "ScrollableArea is not defined". D'oh. So does that mean I need to import it after all? Well about that... import ScrollableArea from '../../plugins/phaser-scrollable.min'; class CreateModeMapEditor extends Phaser.State { create() { this.scroller = this.game.add.existing(new ScrollableArea(100, 100, 200, 400)); var textStyle = {font:"30px Arial", fill:"#ffff00"}; for (var i=0;i<10;i++) { for (var j=0;j<80;j++) { var text = game.make.text(i*330, j*30, "Yes, everything scrolls", textStyle); scroller.addChild(text); } } scroller.start(); } } export default CreateModeMapEditor; That returns this error: "Uncaught TypeError: _phaserScrollable2.default is not a constructor". Among the errors so far, that's probably the one that's somewhat close to being within my very, very limited understanding. But it's not close enough. Project Structure: index.html: <html> <body> <div id="game" width="1366" height="768"></div> <script src="scripts/phaser.min.js"></script> <script src="scripts/game.js"></script> </body> </html> game.js import config from './config'; import transition from './plugins/phaser-state-transition.min'; import CreateModeBoot from './states/createMode/boot'; import CreateModePreload from './states/createMode/preload'; import CreateModePostgame from './states/createMode/postgame'; import CreateModeMapEditor from './states/createMode/mapEditor'; class Game extends Phaser.Game { constructor() { super(config.gameWidth, config.gameHeight, Phaser.AUTO, 'game'); } loadCreateModeStates(mapSize) { document.getElementById('mainOverlay').style.display = 'none'; this.startCreateMode(this, mapSize); } startCreateMode(phaserGame, mapSize) { phaserGame.state.add('createModeBoot', CreateModeBoot); phaserGame.state.add('createModePreload', CreateModePreload); phaserGame.state.add('createModeMapEditor', CreateModeMapEditor); phaserGame.state.add('createModePostgame', CreateModePostgame); phaserGame.state.start('createModeBoot'); } } var phaserGame = new Game(); window.globalGame = phaserGame; Is there anything else I can try? Currently we're doing a HTML Overlay with a table on it on top of the phaser game, but it's tedious at best, and scaling is another can of worms.
  16. @devour Load your meshes or create them in a loop and assign the same material with a different var name++ for the dynamic texture in the material associated with the loop. And define each dynamic texture by the var++ name prior to the loop. This should be very simplified code. DB
  17. jdotr

    Does this example still exist? Point Light

    You can kind of fake it! ...it's distinctly slower than if it was all done in a GL pipeline but it still looks cool and is sufficiently performant if carefully applied (the jitter in the gif is a result of screencap, the scene runs at 60pfs): It's basically two layers: The background (becomes the unlit version) that has the tint set to the ambient color of the light. Next I add the layer that I want to have lit and apply a geometry mask based on a raycast from my light's point. Red Blob Games has a good guide on how raycasting works & how to implement it. My code is not quite in a state that it would be useful to share though I can try to nudge it in that direction if folks want. There are plenty of caveats and limitations on what you can do with this but for a lot of situations this can probably get you pretty close to what you had in mind. best of luck, lmk if you have any questions
  18. dbawel

    Cannot call Dom object

    @RaananW Thanks for being there when I needed help. This is why I love this forum and everyone on it. DB
  19. dbawel

    VideoTexture not working on ios

    To all of you on this post: I've spent weeks trying to crack this using WebRTC and the MediaStream API and have come up null. I'm in awe that you have been able to crack this. My gratitude goes well beyond respect in this case. Congrats for us all. DB
  20. khleug35

    how to do this effect ?

    like this??? https://jsfiddle.net/1sje65a0/5/ function create() { game.stage.backgroundColor = '#000'; arrow = game.add.image(90, 36, 'arrow'); widtharrow = new Phaser.Rectangle(0, 0,arrow.width, arrow.height); arrow.cropEnabled = true; arrow.crop(widtharrow); arrow.fixedToCamera = true; widtharrow.width = 0; game.time.events.loop(800, function() { game.add.tween(widtharrow).to( { width: (widtharrow.width + 60) }, 200, Phaser.Easing.Linear.None, true); }, this); } function update() { arrow.updateCrop(); //loop animations if(widtharrow.width >= 300){ game.add.tween(widtharrow).to( { width: (widtharrow.width - arrow.width) }, 200, Phaser.Easing.Linear.None, true); } } I use crop method to do it . https://phaser.io/examples/v2/sprites/horizontal-crop
  21. Aram

    Use spriteSheet and delete

    Hi all, how can I delete a spriteSheet. My whole game uses one scene, and when user goes from map to gameplay, I have to delete map spriteSheets to load gamplay spritesheets. Thank you!
  22. espace

    how to do this effect ?

    hi, i want to make this effect depending of my picture attached below : mask_1,mask_2,mask_3,mask_final. This effect have an alpha channel ; everything that is not yellow is transparent. how do you do that ? i read the alpha_mask but i don't know how do this .... thanks for your help
  23. Hello everyone, I would like to create a player, when user press spacebar ,the player is shooting right and left at the same time. Is it a clever way to code this.?? The full code and eample , spacebar is shooting button https://jsfiddle.net/8q95wdv1/ Create Two Group //right shoot bullets = game.add.group(); bullets.enableBody = true; bullets.physicsBodyType = Phaser.Physics.ARCADE; bullets.bulletKillType = Phaser.Weapon.KILL_WORLD_BOUNDS; bullets.createMultiple(40, 'bullet'); bullets.setAll('anchor.x', 0.5); bullets.setAll('anchor.y', 0.5); bullets.setAll('outOfBoundsKill', true); bullets.setAll('checkWorldBounds', true); //left shoot bullets2 = game.add.group(); bullets2.enableBody = true; bullets2.physicsBodyType = Phaser.Physics.ARCADE; bullets2.bulletKillType = Phaser.Weapon.KILL_WORLD_BOUNDS; function fire() { if (game.time.now > bulletTime) { bullet = bullets.getFirstExists(false); bullet2 = bullets2.getFirstExists(false); if (bullet && bullet2) { //right bullet.reset(player.body.x, player.body.y ); bullet.lifespan = 2000; bullet.body.velocity.x = 1000; //left bullet2.reset(player.body.x, player.body.y ); bullet2.lifespan = 2000; bullet2.body.velocity.x = -1000; bulletTime = game.time.now + 250; } } } var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render:render}); var player; var cursors; var shootButton; var bulletTime = 0; function preload() { game.stage.backgroundColor = '#ffffff'; game.load.baseURL = 'http://examples.phaser.io/assets/'; game.load.crossOrigin = 'anonymous'; game.load.image('player', 'sprites/phaser-dude.png'); game.load.image('platform', 'sprites/platform.png'); game.load.image('bullet', 'games/invaders/enemy-bullet.png'); } function create() { player = game.add.sprite(350, 200, 'player'); game.physics.arcade.enable(player); player.body.collideWorldBounds = true; cursors = game.input.keyboard.createCursorKeys(); shootButton = game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR); player.customParams = {}; //right shoot bullets = game.add.group(); bullets.enableBody = true; bullets.physicsBodyType = Phaser.Physics.ARCADE; bullets.bulletKillType = Phaser.Weapon.KILL_WORLD_BOUNDS; bullets.createMultiple(40, 'bullet'); bullets.setAll('anchor.x', 0.5); bullets.setAll('anchor.y', 0.5); bullets.setAll('outOfBoundsKill', true); bullets.setAll('checkWorldBounds', true); //left shoot bullets2 = game.add.group(); bullets2.enableBody = true; bullets2.physicsBodyType = Phaser.Physics.ARCADE; bullets2.bulletKillType = Phaser.Weapon.KILL_WORLD_BOUNDS; bullets2.createMultiple(40, 'bullet'); bullets2.setAll('anchor.x', 0.5); bullets2.setAll('anchor.y', 0.5); bullets2.setAll('outOfBoundsKill', true); bullets2.setAll('checkWorldBounds', true); } function update () { game.physics.arcade.collide(player); player.body.velocity.x = 0; if (cursors.left.isDown || player.customParams.isMovingLeft) { player.body.velocity.x = -250; } if (cursors.right.isDown || player.customParams.isMovingRight) { player.body.velocity.x = 250; } if (shootButton.isDown) { fire(); } } function fire() { if (game.time.now > bulletTime) { bullet = bullets.getFirstExists(false); bullet2 = bullets2.getFirstExists(false); if (bullet && bullet2) { //right bullet.reset(player.body.x, player.body.y ); bullet.lifespan = 2000; bullet.body.velocity.x = 1000; //left bullet2.reset(player.body.x, player.body.y ); bullet2.lifespan = 2000; bullet2.body.velocity.x = -1000; bulletTime = game.time.now + 250; } } } function render() { } Thank you very much!!!!
  24. enpu

    Website Down

    Should be back up now!
  25. Asagi

    VideoTexture not working on ios

    Sebavan, this is awesome! Thanks!
  26. Legomite

    Text emoji as game graphics?

    I'm quite new to Phaser too but I believe text objects must be updated via .updateText() to show the change or if you want to set it in one line without doing the two separately you can do this: this.targets[0].setText("😩");
  1. Load more activity