Categories
Uncategorised

Week 25/01/21

This week we needed to make a platformer but we had 2 big differences from how we usually make them. 1, we controlled it through dragging the pointer across the screen. 2, we made it using a different physics system called matter.

The matter system is much more complex than the arcade system we were using and it allows the creation of more complex shapes and systems such as bridges, cloth and ropes. In my customization I used bridges however I will get to this later.

We made a player character that used touch in order to move, the user would drag across the screen and the character would interpret this in one of 3 directions; up, left and right however I changed this in my customization where I made it so that whenever the player drags, where they drag to and how far they drag affects the players direction and speed (with a max speed of course). The amount they dragged was divided by the map’s width and height in order to shrink the speed down to something viewable and controllable otherwise the player clipped through the world bounds at the top of the screen

In my customization I had also added a bridge to the first level for the player to stand on

In order to create this bridge I used an example on the phaser website (Phaser 3, 2021). I modified the code to only the section that creates the bridge as I had no need for dragging the bridge with the mouse or having the two pillars the bridge connects to

Overall I found the matter physics engine more complex than the arcade but the complexity gave more control and ability to add more interesting things such as bridges and cloth

References:

Labs.phaser.io. 2021. Phaser 3. [online] Available at: <http://labs.phaser.io/view.html?src=src/physics/matterjs/bridge.js> [Accessed 25 January 2021].