Jump to content

Phaser - How to access a certain element on the layer


Recommended Posts

Hello i recently started to study Phaser and i have came to a problem witch i need help with solving. I created a 3 layer map with Tiled. SkyLayer, GroundLayer, BrickLayer. I added physics that allow the player to move around the GroundLayer. I also added physics that allow him to jump on the BrickLayer. I am struggling to make a motion that allows the player to jump from the bottom hit the brick with his head, when he hits his head the motion of the brick to move up a pixel and then back down a pixel just as in Mario. I have trouble finding out how to identify which brick section i have hit from the  BrickLayer so i can later on apply the animation to the brick element.

Screen Shot 2017-02-18 at 10.15.23 AM.png

Screen Shot 2017-02-18 at 10.27.16 AM.png

Link to comment
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.

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.


  • Recently Browsing   0 members

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