Search the Community

Showing results for tags 'gamepad'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 32 results

  1. Hello, I'm attempting to implement support in my scene for navigating with a 3dconnexion spacenavigator, which has 6 axes. I can see it successfully registers as a gamepad, and can see four of the six axes bound to the "leftStick" and "rightStick" attributes, however I of course need the extra two axes. I thought about creating a new `3dConnexionGamepad extends BABYLON.Gamepad` class, however I can't think of a way to get the `GamepadManager` to create an instance of my custom class. Is this possible? If not is there a workaround like mabye binding to the `.update()` method of the gamepad instance?
  2. Ohayo! Description: Currently in my free time i'm working on crysis-like 2D shooter game prototype about aliens invasion (events between Crysis 2 and Crysis 3) and specialy trained humans in new version of nanosuit (less power of Prophet suit but more soldiers gets it). It will be multiplayer arena shooter, but for now i'm focusing on singleplayer training mission gameplay, and after i complete with fixing prototype with players feedback i'll start working on the core of the game which is multiplayer arena part. Game works smoothly on Google Chrome (game optimisation for Firefox is on future todo list) and was designed for gamepads (PlayStation and Xbox), but you can play with mouse and keyboard too. Right now aliens are very strong so gameplay is focused on tactics and hide&seek more than just running around and shooting everything you see ;P It runs on mobile too but there is no virtual controls (it's on future todo list) so don't ask me for it now Right now i'm asking you guys to tell me how does controls feels and how much time you had to play to destroy all 4 alien bases (big green dots on minimap, you can kill them only with 2 grenade shots per base :P). Play Online (please, use Chrome): Tech used: - Oxygen Core (my html5 game engine toolset based on best Unity and Godot concepts mixed with latest best html5 apis); - ES7 with babel transpiler; - Webpack for game bundling and live development; I don't know what i should say more about techs, because everything that is there, it is those 3 things If you're interrested in something more about tech, and i will be happy to tell everything you ask ------ BTW. I want to publish topic/article about game engine used here - which subforum should i use to place that kind of topic?
  3. Can anybody explain me how can I setup VRDeviceOrientationArcRotateCamera with gamepad controller. Is this already done or not? How can we attach gamepad with VRDeviceOrientationArcRotateCamera? Greetings Ian
  4. Im quite a newbie to Phaser, I have followed the first game tutorial and adapted it slightly by adding gamepad controls. It works fine on my desktop browsers (chrome and edge both at 60fps) but the controls seem a little laggy when I test it on the xbox one edge browser on my console. I added an fps counter to check if performance was generally worse on xbox but it reports a constant 63fps, and yet the button timings are definitely off. Perhaps the framerate being over 60 is an issue, but I'm not sure. Has anyone had a similar issue or could suggest a fix? I'm running the link below directly to the edge browser on the console, tried setting phaser to both AUTO and CANVAS, but still the same controller lag. And here's a link to the game code:
  5. Gamepad Disconnection Problems

    My Phaser.js version: `v2.6.2 "Kore Springs"` Gamepad: generic Logitech Dual Action controller OS: OSX Sierra Browser: Chrome Update: I can confirm that this also occurs with an XBOX 360 controller. Also see @Cyclone112's comments below for more troubleshooting info. I'm adding gamepad support to my current project, and am encountering the following error when disconnecting the gamepad from the USB input: Uncaught TypeError: Cannot read property 'timestamp' of undefined at c.SinglePad.pollStatus (phaser.js:43607) at c.Gamepad.update (phaser.js:43003) at c.Gamepad.reset (phaser.js:43169) at c.Input.reset (phaser.js:37282) at c.Game.gameResumed (phaser.js:36532) at c.Stage.visibilityChange (phaser.js:31966) at HTMLDocument._onChange (phaser.js:31905) This happens regardless of whether or not I register `onDisconnectCallback` to the gamepad. May also be worth mentioning that I encounter the error when disconnecting from this example: If the Github issue tracker would be a more appropriate place for this, I can post there instead. Any recommendations for a workaround would be great. Thanks!
  6. [PoC] The monster's vault

    Hi everyone! Just wanted to share a small proof-of-concept game I've been working on for a while. It's called The monster's vault. The main goal is to find a way out of a dark creepy dungeon, pull a lever that opens the exit door, while not being caught by a wandering monster that dwells in the darkness, and bla-bla-bla... the whole point here is not about gameplay anyway. This game is inspired by Keith Clark's demo of an HL2 location made entirely by CSS 3d transforms. I tried to repeat his approach by making a browser 3d game with first-person view based on CSS transforms without any use of canvas graphics. My other goal was to try out a number of modern web technologies and APIs available in the browser, so here's what I came out with. ReactJS as a rendering framework and Redux as a game state manager. Kind of a questionable choice for a game, one may think, but hey, as I said, it's a proof-of-concept WIP demo pet home project =) Pointer lock events to control the cursor so that it cannot flow out of the screen. Gamepad api to support my Xbox One gamepad. I haven't been more happy when it actually worked (not sure about other controllers though). Web audio api to control the sounds and the music. It provides a way to place a sound in a 3d space and even make it spread in a certain direction, and that's really awesome. Using your headphones while playing is highly recommended. Service worker makes the game work offline as it caches all the resources after the first load. It can get annoying though, when you start facing the problems with invalidating the cache. I also tried out the svg lighting filters to simulate some shaders on the textures (set on highest graphics quality value in the Settings section). It looks neat but drops the fps dramatically. Some conclusions: declarative 3d graphics with CSS 3d transforms and animations are cool and relatively easy to use, but not performant enough (which is totally fine) modern browsers have some really great APIs helpful for creating various web games making horror games is a huge, huge fun PLEASE NOTE: The monster's vault is only a desktop game and is viewed best in latest Google Chrome. It is inconceivably untested and may not work as expected on most machines and browsers. Some of the technologies used here are still not standardized and may break in the future. Also, the code is not optimised in any way, it weights some MBs. The low rendering FPS is compensated by the high cooler's RPS =) Anyway, I warned you. The game's github repo with some gifs, controls and credits — You can play the game here: Thanks!
  7. I'm currently building a two player platform-shooting game that supports controllers. Right now I have two separate move functions placed in the update that handles player movement. Here's the code: movePlayer1: function () { if (!player.alive) return ; //controller input if(this.pad1.axis(Phaser.Gamepad.XBOX360_STICK_LEFT_X)< -0.1){ this.player_1.body.velocity.x = -300; //move left'left'); } if(this.pad1.axis(Phaser.Gamepad.XBOX360_STICK_LEFT_X)>0.1){ this.player_1.body.velocity.x = 300; //move right'right'); } if(this.pad1.justPressed(Phaser.Gamepad.XBOX360_A)&& this.player_1.body.onFloor() ){ this.player_1.body.velocity.y = -999; //jump } this.player_1.weapon.fireAngle = -(90 + 90 * -this.pad1.axis(Phaser.Gamepad.XBOX360_STICK_RIGHT_X)); if(this.pad1.isDown(Phaser.Gamepad.XBOX360_RIGHT_TRIGGER)||this.pad1.justPressed(Phaser.Gamepad.XBOX360_RIGHT_BUMPER)) {; } }, movePlayer1: function () { //player 2 controller if(game.input.gamepad.supported && && game.input.gamepad.pad2.connected) { this.indicator2.animations.frame = 0; } else { this.indicator2.animations.frame = 1; } if(this.pad2.axis(Phaser.Gamepad.XBOX360_STICK_LEFT_X)< -0.1){ this.player_2.body.velocity.x = -300;'left'); } if(this.pad2.axis(Phaser.Gamepad.XBOX360_STICK_LEFT_X)>0.1){ this.player_2.body.velocity.x = 300;'right'); } if(this.pad2.justPressed(Phaser.Gamepad.XBOX360_A)&& this.player_2.body.onFloor() ){ this.player_2.body.velocity.y = -999; } this.player_2.weapon.fireAngle = -(90 + 90 * -this.pad1.axis(Phaser.Gamepad.XBOX360_STICK_RIGHT_X)); if(this.pad2.isDown(Phaser.Gamepad.XBOX360_RIGHT_TRIGGER)||this.pad2.justPressed(Phaser.Gamepad.XBOX360_RIGHT_BUMPER)){; } } , I feel that this isn't the best way to code for two player movement. What would you do differently?
  8. Bad Pad now on Steam - Early Access

    Ever wonder what would happen if your gamepad's buttons came to life? Join square in his adventures, save Hexagon and Trapezoid from the hands of Evil Pen! Bad Pad is platformer game mixed with a little arcading, shooting, puzzle solving and metroidvania elements, that being said it is still a platformer, so expect a lot of jumping and fair amount of dying along the way. Bad Pad is available for Early Access on Steam now! Devblog, free demo, media kit and more can be found here.
  9. Move the Crates

    Hi all, Check out my web game "Move the Crates". Developed using pixi.js. Game play is similar to "Sokoban". Game is also optimized to work with gamepad. You can play the game here, Some screenshots: Here is the video of the game working in XBOX One browser,
  10. The gamepad attachControl uses: new BABYLON.Gamepads((pad: BABYLON.Gamepad) => { this.onGamepadConnected(pad); }); but this.onGamepadConnected ONLY gets fired ONCE per browser session... If you refresh the page page it never gets fired thus the game pad no longer works... If i totally close down the browser and restart it works again because new instance of browser... What can we do about that???
  11. My post about control mechanisms in JavaScript games was just published on Mozilla Hacks blog. It introduces a series of MDN articles about Implementing game control mechanisms: Mobile touch controls Desktop mouse and keyboard controls Desktop gamepad controls Unconventional controls The basic examples are available on GitHub at And the articles are using Phaser-based game Captain Rogers: Battle at Andromeda demo as a case study.
  12. It is possible do vibrate a gamepad?

    Hello everyone! Is there any way to send a signal to gamepad to make it vibrate? A greeting!
  13. Gamepad plugin help.

    Hi I am using this plugin to implement gamepad support to my ouya/android game: It works great but the problem is that only player 1 works and I want the game to be controlled by any connected gamepad, is there anything I can edit so that the plugin ignores the controller (i.e. player1 or player2...). So that a button on each connected controller will trigger the 'jump' for example.
  14. Help with ludei.

  15. Hi guys, for my game I want to support game pads in my Phaser 2.4.4 game. So far so good, the pad is working. But, if I change the tab for example and than go back to my game, the pad is not responsive anymore. Also I don't get a Disconnect event. So looks like Phaser 2.4.4 still thinks there is a pad or the pads push data dosent arrives the game anymore. I also tested several game pad and all have the same problem. So, is there already a solution for that problem? bye Tom
  16. Issue with Microsoft Edge and Xbox Gamepad

    I've been experimenting with using an Xbox One controller to play my game and while it works fine in Chrome, I noticed justPressed wasn't working on Edge (Haven't tried other methods). I'm trying to run my game on my Xbox but I can usually only press one button before anymore input stops registering. As I mentioned, if I test my game on Chrome on a desktop with the controller, things work fine. I didn't notice any obvious errors in the console either.
  17. Questioning whether to use Pixi or not?

    questioning whether or not to use Pixi? Just remember that the upper limit of a technology is an interplay of the technology itself and the user. I'm by no means the greatest programmer but with some help from the right people and the right technology, awesome things can be achieved: The above demo for our next game (Lux) is done 100% in browser with pixi Better yet, a gamepad is being used to spin the camera! The final product will not be done in html5 (or at least, not only html5), as there would currently be some platform restrictions on it being in html5. Just wanted to share some Pixi eye-candy and hopefully inspiration to thoroughly explore your possibilities (especially as html5 and webgl support becomes more prevalent)
  18. GamePad - Menu navigation

    Hi, I am curious if anyone has used the GamePad to do any type of menu navigation? I would like to be able to support the menu fully with the GamePad just curious if anyone else has done this and has some tips. I am currently using DOM elements for my menu but I am happy to do whatever works best for BabylonJS. Thanks, Matt
  19. Using callbacks on gamepad

    Hey guys I'm trying to get a function to be called each time the gamepad is released. I think I need to use the function addCallbacks() and the property onUpCallback from the Gamepad class. I have Gamepad called pad1 and a function test() that should be called every time any gamepad button is released, but not really sure how callbacks work/correct syntax. Thanks for your help.
  20. Hello! I am totally new to both phaser and game development, but have been working with friends to build a 2D sidescroller using ninja physics. I cannot get the gamepad to work, and all the examples I see for the gamepad on the phaser site seem to be non-functional as well. We are using a custom build of phaser to include ninja physics, and all my code is here: I can get the pad to show up, but the buttons just do nothing. I was following this example, but now I feel silly for that, since it doesn't seem to work, either: Can anyone point me to a working example of a phaser gamepad with ninja physics, or just a general direction for getting this working? Thank you!!
  21. Hi Everybody, I recently started a dev blog about a new game I am working on, I will be posting to it at least once a week. First playable alpha is available on the blog, enjoy! Check it out:
  22. hi everybody. I´m trying to get my gamepad on work. I´ve tested it in the examples from phasers main page. So I´m really sure, that it works in the framework. But my console.log("Gamepad connected", says: "false" (Keyboard input works fine in a different state) I can´t find the reason. Maybe anybody could help me? this code is in my create:;this.pad =;in update: if (this.pad.isDown(Phaser.Gamepad.XBOX360_DPAD_LEFT) || this.pad.axis(Phaser.Gamepad.XBOX360_STICK_LEFT_X) < -0.1) { this.player.x--; } if ( { this.player.x++; } if (this.pad.isDown(Phaser.Gamepad.XBOX360_DPAD_UP) || this.pad.axis(Phaser.Gamepad.XBOX360_STICK_LEFT_Y) < -0.1) { this.player.y--; } if (this.pad.isDown(Phaser.Gamepad.XBOX360_DPAD_DOWN) || this.pad.axis(Phaser.Gamepad.XBOX360_STICK_LEFT_Y) > 0.1) { this.player.y++; } if ( { this.fireBean(); } if (this.pad.justReleased(Phaser.Gamepad.XBOX360_) { this.player.scale.x += 0.01; this.player.scale.y = sprite.scale.x; }after trying with "pad.isDown" I tried also "game.input.gamepad...". Thats the reason for my "code-mix". Thanks for your help by noobing me arround ;-)
  23. Control your 3D with your smartphone

    Hi everyone, I wanted to point everyone to two examples we just put online. They are part of the examples of a new free service named PlugPIN JS that we just launched. This service turns smartphones into remote controls for games, websites and apps. Here are the two links to the examples, both built with Threejs: 1. Simple Shooter 2. Remote Controls with Gyro The second example is fully documented under "onOrientationChange()" in the Docs. We hope you like it and that it sparks your creativity to make your games interactive by using your smartphone. If you have any questions concerning the examples or the JS Library, then please don't hesitate to contact us. We would love to hear what you think about it and how you would like to use it. Joost @ PlugPIN
  24. Hi Everyone, We have just launched a new service and JS library named PlugPIN. This free service makes it really easy for developers to turn smartphones into remote controls for games, apps or devices. You can check it out at: The idea about plugpin is that you can connect any smartphone to any device anywhere. Nog passwords, login's etc. Just fire up your browser, enter the pin and go. Currently there are just two examples displaying the functionality on the homepage. But there are some more examples in the documentation. Please check them out. And if you like it then don't hesitate to test it out. We would really like to know what you think about it and if you would like to use it. If you have any questions or remarks concerning PlugPIN JS. Then please don't hesitate to contact us. We are glad to help you out. Joost @ PlugPIN
  25. Hi, I'm trying to implement gamepad in my game but some points are unclear... I use states, so I have a Menu State and a Play State. I'm unable to dissociate button's events between my states. When I use this code in my Menu State, the console.log will be execute in my Play State: game.input.gamepad.start();this.pad = game.input.gamepad.pad1;var pauseButton = game.input.gamepad.pad1.getButton(Phaser.Gamepad.XBOX360_START);if (pauseButton) { pauseButton.onDown.add(function() { console.log("start"); }, this);}For the moment the only way I find is to call pauseButton.onDown.dispose(); before my console.log but is it the solution ? I've tried some destroy() but I always have an error about Cannot read property 'time' of null... Also, I saw two way for mapping keys. The way I'm using it as you can see above and with pad.addCallbacks(this, { onConnect: addButtons });. I don't understand why in my code the addButtons method isn't call if my gamepad is already plug-in while on my gamepad is already connected and the code works without problems. I think of a scope error but I don't know wich.