Jump to content

Search the Community

Showing results for tags 'keyboard'.

  • 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
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

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

  1. Collect the falling books and rack the highest combos as you can to achieve the best score! Watch out for fireballs! A community made game using Phaser 2! Link: https://tinyurl.com/y37jpqua Features: Global Leaderboard, Discord Authentication, Touch Controls, Keyboard Controls Our Discord: https://discord.gg/DfxF3HPKqQ
  2. Hi, Hope someone can help if I try to do a key press my animation stops until I let go of the key. (keys a and d) to move left and right - is there a way for the key press .onDown to be used once or an aletrantive way to have my animation play when the key is held down, I've tried using the docs but can't seem to find a solution eg demo below http://html5gamer.mobi/2019/ code snippet when pressing d if (this.keyRight.isDown){ this.player.anims.play('walkProper'); this.player.flipX = false; this.player.setVelocityX(150);
  3. Hi everyone, are fine ? Sorry if this question is too simple but I'm losing my sanity for some hours and I don't reach solve the problem alone. I migrating a old project made in Phaser2 to Phaser3 and maybe I the lost the way to do things in Phaser3 way. I trying to the something bellow(phaser2) in Phaser3: input.keyboard.addKey(Phaser.Input.Keyboard.LEFT).onDown(callback); But it don't work on Phaser3, Key don't have onDown method (don't have any method that I see in source code) and I don't know a way to add eventListener to keys. I really don't espect to use verific
  4. How to pass the cursor object to a method that belongs to a class that inherits the Phaser.Sprite class? I have a class that inherits from Phaser.State in which I create a cursor object and pass it to the update method from another class. class Play extends Phaser.State { create() { this.physics.startSystem(Phaser.Physics.ARCADE) ... this.player = new Player({ game: this.game, x: 32, y: this.world.height - 150, asset: 'dude' }) this.game.add.existing(this.player) } update() { const cursors = this.input.keyboard.createCursorKeys(
  5. Reservoir Cleansing. Short arcade type game, just kill the enemies each level: ARROWS (UP & DOWN) - Switch character Z - Attack X - Heal C - Power up (Character upgrades when bar fills) (MAX is Golden armour) It was just a small project to take a break from a big one (kaeBLUE). Won't be doing much to this , but any feedback will help improve any future versions, or even other games. - PLAY ON KONGREGATE - Thanks 😀
  6. hello, Phaser 3: I use this code for a simple text input to get the value of it on ENTER press event: enterE = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.ENTER); but as chrome and some other mobile browsers user "go" instead of "enter", the above event does not trigger! is there any keyCode other than ENTER for that ?? or should use jquery??
  7. At the moment I'm just trying to switch in between game states by having the user press the spacebar. However, when the user holds down the spacebar, it continues to change. Is there a simple way to have the state change only once even when the spacebar is held down? I came across something called JustPressed, but it seems to be behaving in the same fashion as isDown. (rather than cycling through them infinitely when the spacebar is held down) I am brand new to Phaser and Javascript so a simple solution that's easy to understand would be amazing! // define game var game = new Phaser.Game(9
  8. Hi all, I'm having an issue where sometimes .onup isn't registering after releasing a key, has anyone else encountered this? Is there a workaround that will still allow multiple keypresses? Any help is greatly appreciated, many thanks!
  9. Hey there, I'm trying to get a key to always call a certain function, regardless of which state my game is in. At the moment, my code is this: var escKey = null BasicGame.Boot = function (game) { //... }; BasicGame.Boot.prototype = { init: function () { escKey = game.input.keyboard.addKey(Phaser.Keyboard.ESC); escKey.onDown.add(function(){console.log("esc")}, game); } And so on. escKey stays defined in all states, but onDown doesn't trigger. If I move the two lines within init to a state, I can use ESC in that state, but not in any state after that. Is th
  10. I am working on a game which allow the player to enter the answer for math questions. Codes for typing the numbers are working such as: key1 = this.game.input.keyboard.addKey(Phaser.Keyboard.ONE); key1.onDown.add(this.press1, this); However, I can't seem to get the minus(-) working, it does not even trigger the key pressed. keyminus = this.game.input.keyboard.addKey(Phaser.Keyboard.MINUS); keyminus.onDown.add(this.pressminus, this); Is there any way I can implement the typing of '-'?
  11. Hi all. I have a problem managing the ghost character. I need that when the left button is pressed - the character flies to the left up, and play fly sound. But when the right button is pressed while the left button is pressed, the character stopped and stopped playing fly sound. if (this.leftKey.isDown) { //Play Fly sound, when LEFT key is pressed this.playFlySound(); this.ghost.body.moves = true; this.ghost.body.velocity.x = -120; this.ghost.body.velocity.y = -160; //Stop Fly sound, when LEFT key is pressed & RIGHT key pressed to if (this.rightKey.isDown)
  12. My code has a setup function that runs at the start. Within that setup function I have the left and right arrow keys setting up movement like so: left = keyboard(37); left.press = function(){ moveCharacterLeft(); }; It works fine. But then when I get a gameover my game runs a reset code and all variables are reset back to their former states and the setup function runs again. Well this means that the above function runs again as well, and this makes it so that each time I get a gameover and reset the game, the above function will run multiple times for each button press
  13. I'm using the following code to capture key entry, just numbers for now, but I would like to capture all keys. this.key0 = game.input.keyboard.addKey(Phaser.Keyboard.ZERO); this.key1 = game.input.keyboard.addKey(Phaser.Keyboard.ONE); this.key2 = game.input.keyboard.addKey(Phaser.Keyboard.TWO); this.key3 = game.input.keyboard.addKey(Phaser.Keyboard.THREE); this.key4 = game.input.keyboard.addKey(Phaser.Keyboard.FOUR); this.key5 = game.input.keyboard.addKey(Phaser.Keyboard.FIVE); this.key6 = game.input.keyboard.addKey(Phaser.Keyboard.SIX); this.key7 = game.input.keyboard.addKey(Phaser.Keyboar
  14. Hi, In a menu state of mine, instead of pressing spacebar, I would like to let the player press any key to continue. What would be the best way to detect if any key is pressed?
  15. Hello there, I'm new to phaser and the first thing I had a minor quip with was the way animation calls were handled (they look messy and unorganized). I have experience coding in engines such as Vylocity ( http://vylocity.com ) where icon states are handled and managed by the direction the player/npc has chosen to go in. A player is set with an icon "state" which is a specific type of animation, each with its own directional states spit up (with the same number of states for each direction). This state references a file that is icons from a number to a number that those states are bound to.
  16. Hello everyone, can you told me why my code is not working ? i don't understand why is not working, i got inspired with this : https://phaser.io/examples/v2/input/keyboard-hotkeys my code: function preload(){ game.load.image('bulleRpg', 'assets/bulleRpg/bulleRpg.png'); } var spaceKey; function create(){ spaceKey = game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR); spaceKey.onDown.add(drawBulleRpg, this); } function drawBulleRpg() { game.add.sprite(game.world.centerX + 250, game.world.centerY + 150, 'bulleRpg');
  17. Hi everyone, I just tested the keyboard input examples of Phaser on Microsoft Edge and it doesn't work as it should. Sometimes it won't detect key presses or keep a key pressed down even if I already stopped pressing it. I had the same problem with a game we're developing and I even noticed that some of the old games we've developed have the same problem when testing on Edge. Has anyone else had this problem? Should I raise it as an issue on the repository?
  18. In my main scene I add keyboard event listeners to specific keys in the init() state. Also some of those keys need to be disabled at specific time and re-enabled at specific time. How can I disable/enable input on specific keyboard buttons at runtime?
  19. Hi everyone, I'm having some weird issues with Safari on Mac : it seems like using the arrow keys in combination with A messes up the keyboard language. I have a french keyboard (azerty), and if I press A, no issue, A is triggered. If I press the right arrow + A, the A becomes a Q. Is that a known issue? Is anyone having the same issue? Is there something wrong with the way I handle the keys? Here is a JSFiddle to illustrate the issue (open the console to see the logs) : http://jsfiddle.net/PQVnT/1718/ Thanks a log guys!
  20. Hi, I'm currently learning Phaser, and i need to handle key events, so i saw some tutorials and if i want to move my character, i need to know if key is down so, in the "phaser" way, things are done like this: window.checkInputs = () => { let key = Phaser.Keyboard if ( game.input.keyboard.isDown(key.LEFT) ) { console.log('Left is down !') } } And i need to call this method in the update loop, so 60 times / s, phaser will check if left arrow is down, like i come from node.js, i don't like this, i mean it waste resources no ? So, is
  21. Hi Guys. I am new to HTML5 game development.I want to implement 4 buttons on screen(left, right,up and down), which controls the camera.has someone idea how to implement it?? @Dad72, @davrous, @Deltakosh
  22. Hello, I'm trying to call the keyboard on click (InputDown) event. Everything works fine in Android, but on iOS the keyboard doesn't show. I'm running the app through Cocoon Developer App using .zip file openKeyboard: function() { Cocoon.Dialog.showKeyboard({ type: Cocoon.Dialog.keyboardType.TEXT, }, { insertText: function(inserted) { console.log(inserted); }, deleteBackward: function() { console.log("deleteBackward"); }, done: function() {
  23. 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 github.com/end3r/JavaScript-Game-Controls And the articles are using Phaser-based game Captain Rogers: Battle at Andromeda demo as a case study.
  24. I already found the solution for my problem. Please delete this topic.
  25. Is there a way to see the full list of keyboard buttons? For example Phaser.Keyboard.SPACEBAR, Phaser.Keyboard.ONE, Phaser.Keyboard.TWO etc... I cannot see these "constants" in the phaser 2.2.2 docs. For example I need dot, single quote, dash(minus), ~
×
×
  • Create New...