Object Oriented Programming in JavaScript: Build a Breakout Game (JavaScript Tutorial for Beginners)

Pubblicato il: 07 novembre 2023
sul canale di: Piko Can Fly
1,040
35

In this step-by-step tutorial I will guide you through the creation of a Breakout game, where we'll learn the foundation of OOP in javaScript.

We'll break down the entire process, helping you grasp key OOP concepts. You'll gain a deeper understanding of JavaScript's object-oriented capabilities as you build a complete game from scratch.


What you will learn:
Object Creation: We'll start by creating objects for the game's elements, such as the ball, paddle, and bricks, using JavaScript classes.
Collision Detection: Master the art of collision detection as you ensure that the ball interacts correctly with the paddle and bricks.

Game Logic: Implement the game's logic, including the movement of game elements, scoring, win detection, and loss conditions.

OOP Principles: Explore key OOP principles such as encapsulation, to organize and structure your code effectively.


For your reference:
Github Repo:
https://github.com/PikoCanFly/BreakOu...

#javascript #learn #oop

Chapters:

00:00 - What we will do in this tutorial
00:15 - What are objects in OOP
00:25 - Object Oriented Breakout game
01:15 - Project Scaffolding
01:55 - Canvas Element
02:58 - The ball object
04:42 - draw method
09:00 - canvas context
09:18 - create a new instance of the ball object
10:21 - use draw method to draw ball
10:55 - game loop
12:40 - Request Animation Frame
13:15 - Define Paddle Class
16:00 - create paddle instance
17:14 - adding event listeners to control paddle with left and right keys
18:30 - ball collision detection
21:14 - paddle collision detection
24:30 - Brick Class


In questa pagina del sito puoi guardare il video online Object Oriented Programming in JavaScript: Build a Breakout Game (JavaScript Tutorial for Beginners) della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Piko Can Fly 07 novembre 2023, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 1,040 volte e gli è piaciuto 35 spettatori. Buona visione!