Fuzzy27 Posted October 17, 2015 Share Posted October 17, 2015 Hi, i am a newbie in using Phaser and i am trying to figure out how i can add the space bar as key for "upwars" Therefore i was looking at phaser.js how createCursors() is realized and tried to enhance it like this cursors = game.input.keyboard.createCursorKeys(); cursors2 = game.input.keyboard.addKeys('up', Phaser.Keyboard.SPACEBAR); but using it like cursors2 = game.input.keyboard.addKeys('up', Phaser.Keyboard.SPACEBAR); i get the error: Unable to get property 'isDown' of undefined or null reference Has anybody a hint how to solve that? Link to comment Share on other sites More sharing options...
rich Posted October 18, 2015 Share Posted October 18, 2015 game.input.keyboard.addKeys({ 'up': Phaser.Keyboard.SPACEBAR, 'down': Phaser.Keyboard.DOWN, 'left': Phaser.Keyboard.LEFT, 'right': Phaser.Keyboard.RIGHT });It's an object. tidelake 1 Link to comment Share on other sites More sharing options...
Recommended Posts