Search the Community

Showing results for tags 'keycode'.



More search options

  • 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

Found 2 results

  1. I have this code: var myKey = SI.gameObject.input.keyboard.addKey(SI.gameObject, 32); myKey.onDown.add(function () { console.log("space"); }, SI.gameObject); When pressing Space the browser scrolls down. I want to prevent this but still be able to detect when i pressed Space. Yes there is method game.input.keyboard.addKeyCapture() which does the job, but it also disables Space button completely i.e I don't detect when the button is pressed. Any ideas if this is possible in Phaser?
  2. Hi everyone. I'm playing around with TypeScript and Phaser for the first time. I started off with plain Javascript/Phaser in Sublime and got a little game going where I could move a sprite around the screen and click to shoot. It worked relatively easily which was nice. Then I decided to switch to TypeScript and Visual Studio because intellisense and the class/inheritance syntax looked like it would make things easier. I still have hope, but I've run into some problems. The first issue that came up was setting up WASD controls with AddKey. I tried to use the recommended var movementLeftKey: Phaser.Key = game.input.keyboard.addKey(Phaser.KeyCode.A);but I got the message: Property 'KeyCode' does not exist on 'typeof Phaser' I got around it by using var movementLeftKey: Phaser.Key = game.input.keyboard.addKey(Phaser.Keyboard.A)This made me think that I was using the wrong version of phaser files since 2.4.4 ought to allow KeyCode. Unless I'm doing something wrong(certainly possible), I believe I'm all up to date. I have p2.d.ts, phaser.d.ts, phaser.js, phaser.min.js, and pixi.comments.d.ts from https://github.com/photonstorm/phaser/tree/master/typescript all in my project as recommended in the typescript tutorial: http://phaser.io/tutorials/how-to-use-phaser-with-typescript I wanted to use phaser.comments.d.ts instead of phaser.d.ts, but it looks like it hasn't been updated - the version appears to be 2.4.3 rather than 2.4.4 Another issue is with detecting mouse clicks. Before typescript/visual studio, I used game.input.activePointer.leftButton.isDown to check if the player was clicking. Visual Studio won't even compile that because it says game.input.activePointer.leftButton is a boolean. All of the Phaser documentation says it's a DeviceButton, and I've even printed out the value with console.log and it says it's an [object Object], so definitely not a boolean. Any ideas why Visual Studio thinks otherwise? I am using the most recent version of typescript that came installed with Visual Studio 2015 Community. Here's my project on Github. I haven't ever used github before so if something appears messed up with how I uploaded it, that's why and please let me know. The code dealing with mouse and keyboard input is here. Thanks in advance for any advice.