Add exact physics in order to give the game a more natural look.
- Hello and welcome to video of…adding the game physics.…We're gonna look into the physics logics…required for this game.…And we're gonna implement the physics logic…on the ball, bricks, and paddle.…In the previous section, we've created this demo.…As you can see, the ball has an x speed and y speed.…And it goes through the bricks…without any return logic, without any physics logic.…So in this section, we're gonna add the physics logic…which is gonna give the game a more natural look.…If a ball hits the brick, it goes back.…
So let's take a look at the code.…Now, first thing we're gonna do,…is if you recall in the previous section,…we just added y speed to the x value…and reduced it from the x value every time.…Now, this was for demo purposes.…Now we're gonna add a more natural movement.…Which means that if the ball is going up,…then we're gonna handle the y values only.…The y speed is reduced from the ball y value.…In each take.…
Otherwise, the ball is going down,…then we're gonna add the y speed to the y value.…
Note: This course was created by Packt Publishing. We are pleased to host this training in our library.
- Playing sounds in various browsers using SoundJS
- Tweening objects using TweenJS
- Creating graphic assets and basic animations
- Game stage creation and object positioning
- Adding the basic game logic
- Add the game physics
- Adding mouse and keyboard controls
- Debugging with breakpoints in Chrome
- Debugging on Android and iOS
- Character movement and input handling