Jump to content

Can i set a collision area in a sprite? [Phaser]


Recommended Posts

Hi guys i just wanted to know if i can set something like a collision area in a sprite. I need to do that because i have a player sprite, who colides with trees and other stuff, i'll post images to make it more simple to understand.

Okay this is my game: http://prntscr.com/dasmyg

The player is suposed to collide with the tree's log, but when i come near to the tree, the collision is more like that: http://prntscr.com/dasns6

Thats because my sprite is 16x32, well he is only 19 pixels height, the rest its transparent, but its still there so its detected like a collision.

Maybe you will say me i have to resize the sprite to be only 19 pixels height, but then it will look like this: http://prntscr.com/dasp2e

And i want him to look like this: http://prntscr.com/daspb5

I want him to touch the tree with his head. So, is there a way to do that? 


PD: I edited the last photo to make the overlay


Link to comment
Share on other sites


  • Recently Browsing   0 members

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