madmarcel Posted May 4, 2015 Share Posted May 4, 2015 I working on my first game in Phaser, a pirate baking sim, where the player controls two hands using mouse and keyboard and interacts with items on the kitchen bench. BUT I got stuck on a specific problem: I would like to be able to find a point under the 'hands' of the arms, so that I can use that to add items in the correct place in the gameworld,and I want to use the same point to identify what is under the 'hands', so that the user can interact with and pickup items. The x and y coordinates of righthand.getBounds() are close to correct, but I suspect that is not the correct approach. The arms are currently just plain sprites, fixed to the camera and anchored to rotate around the bottom center edge. // right armthis.rightHand = this.handsGroup.create( 1074, 800, 'righthand' );this.rightHand.scale.set(0.75 , 0.75 );this.rightHand.anchor.setTo(0.5, 1.0);this.rightHand.frame = 0;this.rightHand.rotation = this.arms.rotR;this.rightHand.fixedToCamera = true;Is there is an easy solution or am I modelling my game incorrectly? The (unfinished) pirate baking game with graphics, music. hookhands etc is here: http://gamejolt.com/games/strategy-sim/arrrr-pirate-baking/64428/ I've attached a zip file with a cut down version of the code (feel free to use it to make yer own pirate arm waving game, arrrr! The attached code omits the heaving bench and sliding objects. Thanks, Marcelarmpicker-phaser.zip Link to comment Share on other sites More sharing options...
Recommended Posts