madmarcel

Pirate pancakes and picking/adding items to game world

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.