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

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.