All Activity

This stream auto-updates     

  1. Yesterday
  2. rich

    Plugins Phaser 3 matter.js matter-attractors

    The Matter Attractors plugin is already built-in, you just need to specify it in the Scene config. There's an example for it here: http://labs.phaser.io/view.html?src=src\physics\matterjs\attractors.js
  3. b10b

    So, what's the deal with sound?

    @ItsYaBoiWesley all the theory is here - you need to capture an Interaction Event before sound can be heard - and the links provided above are precise. For specifics to your use case show us some code and someone might be able to help more. For example do you have an interaction event (click, touchend) that plays the first sound (or resumes the audioContext)? As to why you get sound on W3schools but not on your own implementation that's a fair question. W3schools example doesn't play sound for me (unless I have already clicked on the page or buttons). I also don't see anything in their code that would resolve these issues directly, so if you're hearing sounds without interacting with their page then it's probably down to your "Media Engagement Index" with their site (iirc Chrome tries to not be too annoying and allows autoPlay for some sites based on usage history). Remember, although this policy is a new feature of Chrome, the requirement for an interaction event prior to audio has always been the case for iOS Safari. So audio frameworks like SoundJS and Howler do definitely have widespread solutions. My approach has always been to trigger a "silent" sound on first interaction event, after which all audio is open for business.
  4. I'm not understanding how to incorporate plugins... especially for matter-attractors. my config file looks like this, I'm bringing in another plugin that worked well, and had good instructions. type: Phaser.AUTO, parent: "my game", canvas: document.getElementById("game"), width: 1500, // window.innerWidth height: 1500, // window.innerHeight pixelArt: true, roundPixels: true, physics: { default: "matter", matter: { gravity: { scale: 0 }, debug: true, }, }, plugins: { scene: [ { plugin: PhaserMatterCollisionPlugin, // The plugin class key: "matterCollision", // Where to store in Scene.Systems, e.g. scene.sys.matterCollision mapping: "matterCollision", // Where to store in the Scene, e.g. scene.matterCollision }, { plugin: MatterAttractors, key: "matterAttractors", mapping: "matterAttractors", }, ], }, }; You can see I'm trying to use it there at the bottom... I'm not having any luck. I'm expecting to see them in the console when they get in by using this: this.plugins.scenePlugins I'm hoping someone call show me what needs to change. here is matter-atractor's github link
  5. B3L7

    Collisions not detecting with Phaser

    It's not the same code. Notice game.physics.add.sprite as opposed to what you have: game.add.sprite. Big difference. You could of course use game.add.sprite and add a body on as a separate line. Either way in order for two game objects to collide they either need to have physics bodies or be apart of a physics group.
  6. MC_CatMaster

    Collisions not detecting with Phaser

    That’s the same code I already have. And I will switch to groups later. At this point I just want to get this working so I know what’s going wrong.
  7. Wingnut

    GUI Fill

    hahaha... damn, I am SO blind. (hug) Hey DylanD.. are you on the new forum, yet? Perhaps start a new Q&A thread over there... "Testing GUI Health Meters" (anything you choose)... and we'll keep doing experiments and talks. Meantime, I'm marking this thread as solved. Message me if you want it re-opened for some reason. See ya soon at the new forum.
  8. Marking solved. PM me if needed.
  9. Deltakosh

    changing camera pivot point to selected mesh

    Hello, do you mind asking the question on our new forum? forum.babylonjs.com
  10. Hey, I'm Andrew. I've been making games for 7 years now and have experience on the programming and art side of things. I can do art for all aspects of the game - characters, backgrounds, GUI, logo, promo material or any other specific asset you may need. I can also do a range of art-styles to match your game's theme and design brief. I work at £13 per hour but can work at a fixed price too if you have an asset list. I'm a fast worker and good with deadlines and will do a few test assets for you before you commit to me so you know what direction I'm going in. Below is a collection of my art, If you have any inquires or want to see more examples you can message me on here or email me at andrewtidey@hotmail.com and I'll get back to you soon 😉 One of my games RabbitShark: Some free assets I made: And the logos from some of my games: Thanks for looking!
  11. chicagobob123

    Hololens Development

    I am using a C# application that uses web sockets to communicate. It works well exchanging information
  12. jogosgratispro

    [For Hire][Remote] PhaserJS 2/3 - PixiJS Dev

    I sent you an email (Eu te mandei um email)
  13. @ekarda I imagine you don't want a "click to play" button on the e-card? So options that allow sound to be heard directly from a new user opening a new link will be limited (Media Engagement Index might kick in for repeat visitors who engage with the cards). A creative approach might be to ask the user to "open their card" taking it out of an envelope and thereby capturing the interaction event necessary to enable autoplay?
  14. Hail! I was perusing the site and found the documentation on the action manager. So I created this playground to swap the camera target on double click. https://www.babylonjs-playground.com/#7JOOL#18 It seems to work ok but i noticed that when I change the camera target, the camera's pivot point stays the same. How do I get it to pivot around the selected mesh? Also, I noticed that sometimes I have to double click more than once to change target. Is that because I'm trying to swap too fast?
  15. B3L7

    creating an object

    If you are using separate textures for each sprite you can use blocks.setTexture('dud'); If you are using a texture with multiple sprites in it you can use blocks.setFrame('dud'); Then you can check at the start of the function against the texture or frame name to see whether to spawn a coin on collision. Hope that helps.
  16. B3L7

    Collisions not detecting with Phaser

    It looks like your blocks don't have bodies. Try: for(var j = 0; j < map.length; j++) { mapObjs[i][j] = game.physics.add.sprite(32*i, 300+32*j, 'block'); mapObjs[i][j].width = 32; mapObjs[i][j].height = 32; } Of course I think you are doing a lot of extra work (not to mention an unnecessary loop in your update method) by not using groups: Group Example
  17. Deltakosh

    GUI Fill

    It does not work because of line #19
  18. JohnK

    Fading mesh color on edges

    Hi @WhoAteDaCake well done for finding the answer. Please note that for future questions I suggest you join the new forum. As more and more people have already changed you might find that getting an answer on this one takes longer and longer☺
  19. MC_CatMaster

    Collisions not detecting with Phaser

    game.physics.add does not exist. You have to use arcade to specify which physics engine to use.
  20. WhoAteDaCake

    Fading mesh color on edges

    Turns out the issue was me not exporting UV maps from blender.
  21. WhoAteDaCake

    Fading mesh color on edges

    I have a mesh, that I would like to colour in a way, that the colour fades out near the edges. The sandbox: https://codesandbox.io/s/zw63povrz4 My current approach uses canvas, to first draw the color texture and then drawing an opacity layer that will fade the colour out. Expected result: https://i.imgur.com/YUCicAf.png My questions: Is there an easier method to do this. In my current approach The texture does not fit on the mesh, which means the mesh does not show any fading out, as can be seen in canvas on the side. How can that be fixed?
  22. Hi, sorry for the late response! Currently I use a pretty standard material workflow, in Maya Redshift - Diffuse Color/rsNormalMap/Reflection Roughness/Metalness - I'm not entirely sure what others might benefit from though. Thank you for looking into this, happy to test anything you guys are working on
  23. If you use original Phaser (not phaser-ce) than depending on how old your current implementation is it should be fairly easy to upgrade to my @orange-games/phaser package which is an maintained version of Phaser 2.6 with just bug fixes here and there. It includes support for the recent Chrome audio shit.
  24. @thrice Thanks for all your input Yea I was going for a fog of war effect, I am actually doing the calculation on the vertex shader, and passing it down to the fragment shader. Never heard of custom render targets I guess that's something I could look into.
  25. Hello everyone. I have built a game using Phaser. On game over, the players high score is recorded in a variable (this.inputScore). To submit their high score to the server, the player clicks a button that takes them to an Index.html page where there is a form they fill in. To avoid cheating, I want the high score variable to be passed from the game's JavaScript file (Game.js) to an input value on the form as a read only value. I have created a function (assignValue) inside the Game.js file to execute this task, but because of it's scope I cannot get the function to be read by the Index.html file. When I place the function at the top of the Game.js script (globally) the Index.html reads the function and executes it accordingly (but with a hard-coded value for testing purposes.) How can I get the Index.html file to read my assignValue() function and pass this.inputScore to the input value in Index.html? Any help would be greatly appreciated - still learning. Thanks. Game.js file: //INDEX.HTML READS THE assignValue function BELOW (WITH A HARD CODED VALUE FOR TESTING) AND //APPLIES IT BECAUSE IT IS IN GLOBAL SCOPE. BUT I NEED THE VALUE TO BE A VARIABLE TAKEN FROM THE //assignValue FUNCTION INSIDE THE GAME CODE. SEE GAME CODE BELOW: function assignValue() { document.getElementById("inputScore").value = 127; }; //GAME CODE var CrystalRunner = CrystalRunner || {}; CrystalRunner.GameState = { init: function() { //...code here }, create: function() { //...code here }, update: function() { //..code here //check if the player needs to die if(this.player.top >= this.game.world.height && this.counter === 0 || this.player.left <= 0 && this.counter === 0) { this.gameOver(); } }, gameOver: function(){ this.game.time.events.stop(); this.player.body.enable = false; //..code here this.updateHighscore(); //..code here }, updateHighscore: function(){ this.highScore = +localStorage.getItem('highScore'); if(this.highScore < this.myScore){ this.highScore = this.myScore; this.inputScore = this.highScore; this.congrats = this.game.add.sprite(this.game.world.centerX-193, this.game.world.centerY-20, 'congrats'); this.congrats.inputEnabled = true; this.congrats.fixedToCamera = true; this.submitScoreButton = this.game.add.sprite(this.game.world.centerX-135, this.game.world.centerY+100, 'submitScoreButton'); this.submitScoreButton.inputEnabled = true; this.submitScoreButton.fixedToCamera = true; this.submitScoreButton.events.onInputUp.add(function() { window.location.href = "index1.php"; }, this); } localStorage.setItem('highScore', this.highScore); }, //THE FUNCTION BELOW IS NOT BEING READ BECAUSE OF SCOPE. HOW TO I MAKE INDEX.HTML READ IT? assignValue: function() { document.getElementById("inputScore").value = this.inputScore; }, }; Index.html file: <?php require_once 'dbconnect.php'; ?> <!DOCTYPE html> <html lang="en"> <head> <title>Crystal Candy Game Login</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css"/> <link href="css/style.css" rel="stylesheet"> <script type='text/javascript' src='js/jquery-2.2.3.min.js'></script> <script> $(window).on('load', function() { $('#status').fadeOut(); $('#preloader').delay(350).fadeOut('slow'); $('body').delay(350).css({'overflow':'visible'}); }) </script> </head> <body onload="assignValue()" class="bg"> <div id="preloader"> <div id="status">&nbsp;</div> </div> <div class="wrapper"> <div class="texte"> <header> <h1>SUBMIT YOUR SCORE</h1> <img id="logo" src="assets/images/logo.png"> </header> <p>Submit your highscore and you could stand a chance to win a prize!</p> </div> <div id="main"> <form id="form-style" method="post" action="crystalhandle.php" autocomplete="off"> <div class="form-group"> <label class="header-text"><span>First Name</span></label> <input class="form-control" type="text" id="name" name="username" placeholder="Name" title="Please enter your Firstname" required=""> </div> <div class="form-group"> <label class="header-text"><span>Surname</span></label> <input class="form-control" type="text" id="name" name="surname" placeholder="Surname" title="Please enter your Lastname" required=""> </div> <div class="form-group"> <label class="header-text"><span>Email</span></label> <input class="form-control" type="email" id="email" name="email" placeholder="Mail@example.com" title="Please enter a Valid Email Address" required=""> </div> <div class="form-group"> <label class="header-text"><span>Phone</span></label> <input class="form-control" type="tel" id="name" name="phone" placeholder="Phone" title="Please enter your Phone No" required=""> </div> <div class="form-group"> <label class="header-text"><span>Score</span></label> <input class="form-control" type="tel" id="inputScore" name="score" value="" readonly> </div> <!-- I need the above input value to have the variable from assignValue inserted into it--> <div class="w3ls-btn form-group"> <div class="wthreesubmitaits"> <input type="submit" name="signup" id="reg" class="button" id="next1" value="Send" style="font-family: sans-serif; font-size: 17px; font-weight: bold;" </div> </div> </form> </div> </div> <script type="text/javascript" src="js/phaser.min.js"></script> <!--the below js file is where assignValue() is defined:--> <script type="text/javascript" src="js/states/Game.js"/></script> </body> </html>
  1. Load more activity