xronn Posted February 14, 2014 Share Posted February 14, 2014 Hi, My game is top down and I can't walk down certain passages because my sprite body has inherited the full height of the sprite frame. http://puu.sh/6VGeY.png (See issue)So i'm trying to half the size of the sprites body so the players head basically has no clip allowing me to walk down passages. This is what I came up with but doesn't seem to work.//Drawing the hero hero = this.add.sprite(295, 385, 'hero'); hero.body.collideWorldBounds = true; hero.body.halfHeight = Math.floor(hero.currentFrame.sourceSizeH / 2); Link to comment Share on other sites More sharing options...
rich Posted February 14, 2014 Share Posted February 14, 2014 halfHeight is a read-only property, you want to look at resizing the body (via setSize in 1.1.3) Link to comment Share on other sites More sharing options...
xronn Posted February 15, 2014 Author Share Posted February 15, 2014 Edit fixed it for setSize I used hero.body.setSize = (hero.height = 22);Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts