Jump to content

Pirate pancakes and picking/adding items to game world


madmarcel
 Share

Recommended Posts

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:

 

awdY8YW.png

 

 

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,

 

 

Marcel

armpicker-phaser.zip

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...