# Trouble resizing body of MatterSprite when trying to make game responsive

**URL:** <https://phaser.discourse.group/t/trouble-resizing-body-of-mattersprite-when-trying-to-make-game-responsive/753>\
**Category:** Phaser 3\
**Created:** [January 14, 2019, 7:16pm UTC](https://phaser.discourse.group/t/trouble-resizing-body-of-mattersprite-when-trying-to-make-game-responsive/753 "2019-01-14T19:16:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Angelo](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/angelo/32/498_2.png) [@Angelo](https://phaser.discourse.group/u/Angelo)\
**Post date:** [January 14, 2019, 7:16pm UTC](https://phaser.discourse.group/t/trouble-resizing-body-of-mattersprite-when-trying-to-make-game-responsive/753/1 "2019-01-14T19:16:09Z")

</div>

Hello all!

I’m pretty new to Phaser (and game development in general), and I’m having a bit of trouble with resizing MatterSprite bodies in my Phaser 3 game. For a bit of background, I want to keep the game in a 3:2 aspect ratio, and resize the game div (and all game assets) to fit the screen size.

For the most part, I’ve got that working by calling `resize()` on the `game` and the main `camera`, and then calling `setZoom()` on the camera as well.

But!

I’ve created body shapes in PhysicsEditor for my sprites, which I attach to the sprites using `.setBody()` — and I’m having a heck of a time scaling these by the same amount as the sprite itself. I’m at a loss on how to do this, and I’ve created a sample project here to show what I’m talking about:

> **[morning-chord](https://glitch.com/~morning-chord/)**
>
> A sensitive project that does dope things

(You can remix the project for yourselves, or click on the ‘Code’ button in the embed to see how things are set up.)

The game natively runs at 1200 x 800, and there are only two assets: a background image and a car sprite. Clicking on the car will swap the textures and the body. But resizing the browser (or reloading the page after resizing) doesn’t scale the car’s physics body, only the texture itself.

I’ve tried calling `car.body.setScale(amount)` (where `amount` is some value) but it doesn’t seem to do anything. I think I’ve got a fundamental misunderstanding of the relationship between matter.js sprites and their bodies.

Any thoughts you all might have would be deeply appreciated!

---

<div class="post-metadata">

**Author:** ![hcakar](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/hcakar/32/459_2.png) [@hcakar](https://phaser.discourse.group/u/hcakar)\
**Post date:** [January 15, 2019, 11:52am UTC](https://phaser.discourse.group/t/trouble-resizing-body-of-mattersprite-when-trying-to-make-game-responsive/753/2 "2019-01-15T11:52:43Z")

</div>

Hi @Angelo  
I can’t help with physics but i can tell that resize helped a lot 😄

Thanks.

---

<div class="post-metadata">

**Author:** ![Angelo](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/angelo/32/498_2.png) [@Angelo](https://phaser.discourse.group/u/Angelo)\
**Post date:** [January 15, 2019, 9:01pm UTC](https://phaser.discourse.group/t/trouble-resizing-body-of-mattersprite-when-trying-to-make-game-responsive/753/3 "2019-01-15T21:01:26Z")

</div>

Ah, moving the `resizeApp()` call from the root of the game.js file and into the `create()` function fixed this issue. I don’t know exactly why, though, so if there’s any insight on that I’d love to know!
