valueerror Posted February 26, 2014 Share Posted February 26, 2014 As you can see here : http://test.xapient.net/phaser/touch.html i managed to make a virtual gamecontroller with gamecontroller.js (source: https://github.com/austinhallock/html5-virtual-game-controller )the problem with this is.. its horribly slow.. the joystick is the slowest so i use the dpad but for some reason the whole game get's even slower on every restart (if you die for example and respawn - game is a 3rd slower - die again - game slows down again)furthermore it seems like an unwanted overload if you can implement nice buttons with phaser quckly.. so i made these:http://test.xapient.net/phaser/unfortunately you can click on them with a mouse.. but no touch them.. i do not want to set a function that is triggered on touch because for my purpose i have to ask for the state.. i need something likepseudo:if (buttonLeft.isDown) { left = true; } else { left = false;} if (buttonRight.isDown) { right = true; } else { right = false;}i read through other posts and the docs for hours but i can't figure it out.. so help would be very much appreciated thx! Link to comment Share on other sites More sharing options...
valueerror Posted March 1, 2014 Author Share Posted March 1, 2014 hmm... i thought this would be an easy one.. isn't there a way to find out if a button is over, down or nothing? there should be since you can define different frames for the different states of a button.. guess i have to read more source and do more trial and error.. Link to comment Share on other sites More sharing options...
valueerror Posted March 1, 2014 Author Share Posted March 1, 2014 OK.. I think the proper way to handle this is with events. There is one for over,down,out,up and so on in the docs... And then you can provide your custom function that is called... Link to comment Share on other sites More sharing options...
Recommended Posts