Categories
JavaScript Phaser Game

Dev log week 4 – 04/11/22

this week I focused on getting started with my 2D phaser prototype but had also been introduced to 2D physics which I could implement into my game if there is time and I’m on schedule.

2D prototype

For my prototype, I didn’t do too much to start the game because I was looking at examples of the mechanics I want to add but I did add basic movements like walking left/right and jumping. I also added it so that when you hold down you go down faster but I’m not sure if I will keep it in the final version. So there are no animation problems when you hold down left and right I have made it so the character comes to a stop instead of still moving so there are no visual animation errors. Before I started on the movement I made sure I had the preload, create, and update functions typed out and also the width and height of the game ready for me to start building in the viewport.

if (cursors.right.isDown && cursors.left.isDown)
        {
            player.setVelocityX(0)

I also preloaded assets that I needed and placed one platform so I could work on basic character movement.

2D Physics

I was also introduced to 2D physics this week and after learning the basics about static and dynamic bodies I looked into some examples of 2D physics that could be used in-game. One that I was interested in was a bridge that is affected when another object is on it so it works like a rope bridge(https://piqnt.com/planck.js/Bridge). This is something I would like to add to my game if there is enough time in the end. adding this would make the world around the player a little bit more interesting.

After being introduced to 2D physics I also looked at different types of collisions and how they work. It was helpful to know these different types of collision because I know that for my game all objects will have to use bounding-box collision because none of them rotates but if I were to do a top-down game I might use circle collision because my character would be circular and rotates often.

Leave a Reply

Your email address will not be published.