
Learn how JavaScript objects store multiple key-value data using object literals or constructors, access members with this and dot notation, and create methods like get full name, including nested objects.
Learn JavaScript array types, including brackets-based arrays and the new Array constructor, indexing to access elements, and for loops with console.log; understand homogeneous and mixed arrays.
Explore switch statements in JavaScript, comparing them to if-else, and learn to execute code blocks based on the value of an expression using cases, defaults, and break with name examples.
Master the JavaScript for loop to execute code repeatedly using initialization, condition, and update, including printing array elements with console.log and using array.length for dynamic loops.
See how a while loop repeats code until a condition is met. Recognize it needs only the condition, unlike a for loop with initialization and iteration.
Explore how the this keyword in JavaScript points to the calling context, differentiating global window scope from object instances, and show how each object gets its own copy of properties.
TypeScript is a JavaScript superset that adds features and static types. It compiles to JavaScript for browser execution.
Explore array types in TypeScript and JavaScript, including homogeneous and heterogeneous arrays, nested arrays, and using any to mix data types with examples of friends and marks.
Preload scene loads all assets, including images and audio, using the phaser library, before using them in the game, and requires adding the scene to the game configuration.
learn to make a rocket interactive by listening for pointer down events and adjusting its alpha to 0.5 for a little transparency.
Discover how to move a rocket with tweens, setting duration, y position, and alpha, using on complete handlers and scene scope to regenerate a new rocket at center and repeat.
Learn to animate a walking mummy in phaser by loading assets, configuring arcade physics, and building the project with npm install and npm run build.
Create and play looping mummy animation in the main scene by defining the work animation with frames and a mummy sprite, then enable repeat and move along the x axis.
Export a single class across the project using export default to access it from anywhere, ensuring reusable code across folders.
Create a tile group by importing the single tile class, looping through tile configs, and exporting the group as default for instantiation in the scene.
Create a player class in Phaser with arcade physics, add it to the scene, and initialize attributes like isDead, halt, and map size via the constructor.
Create and label tiles and levels, build level one using symbols, and encode the map so the player is rendered at the correct positions.
Add a loading screen to a JavaScript game by using getElementById to access the HTML element, make it transparent after 2 seconds, then remove it to reveal the game.
Create an enemy class extending Phaser physics with a protected dead property, getters and setters, and death handling that stops animations, zeroes velocity, and triggers removal.
Add a slime enemy by extending the existing enemy class, implementing crawl animation and physics, and setting a velocity of -60 to crawl across the scene.
Nowadays, JavaScript can be used to make games, it brings the question of how good it is to use it for such tasks?.
Yes Indeed! JavaScript is a great language for game development, depending on the type of game you want to create. JavaScript is best for web-based and mobile games. It’s also a great language for beginners to learn because it’s generally easy to understand and has plenty of libraries and modules available.
JavaScript games can be played in the browser or mobile phone, so, if that’s your goal, it’s an excellent option. Using platforms and tools can help create both 2D and 3D games that can run directly in your browser. Aside from only web-based games, JavaScript has been increasing in popularity in mobile game development.
Many popular online games were built using JavaScript. Students who want to create JavaScript game coding can start building one taking examples from one of the following:
Tower Building: is a great way to get started with JavaScript games.
Bejeweled was created as an in-browser game in the early 2000s. It’s similar to Candy Crush where you have to match three jewels in a row to score points.
2048 is an addicting game that allows you to use your arrow keys to move tiles around in a grid. The idea is to merge tiles until they equal 2048.
Polycraft is a 3D game that is playable in your browser. Polycraft is full of adventure, exploration, base-building, gathering, crafting, and even fighting. It’s an excellent example of how you can move past 2D games with Javascript.
Words With Friends 2 is a mobile app game that uses React Native, a framework that utilizes JavaScript to create mobile applications. They chose to use React Native for its ability to create a game that can be played on multiple platforms using JavaScript with one code-base.
See, how fun and rewarding it can be using JavaScript for building games, Let us look at some projects we are going to build in this course:
1. Hill climbing game: Famous android game but its idea of making vehicle move in hills is never old when it comes to web. We uses different concepts such as webpack, and physics module from phaser library to make this game.
2. Platformer 2D: we will have detail idea about sprites and how to use them in our games. We will create map (environment) and players from scratch. Different levels will be made and triggers/colliders will be added to make player change from one level to another.
3. Basics of Phaser library: Different programs to load images, follow camera, loading animations will be created.
I really enjoyed creating this course. Hope you will also have fun learning. See you at the class!