Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

freeCodeCamp

Code a 2D Game Using JavaScript, HTML, and CSS (w/ Free Game Assets) – Tutorial

via freeCodeCamp

Overview

Learn to code a 2D game using JavaScript, HTML, and CSS with this tutorial. The course covers creating player and game objects, animation loops, keyboard inputs, projectile creation, collision detection, game UI design, enemy classes, power-ups, particle effects, and more. The teaching method involves building a game from scratch using vanilla JavaScript, HTML5, and CSS3, with no frameworks or libraries. This course is intended for individuals interested in game development and programming, with a focus on 2D game design using web technologies.

Syllabus

⌨️ Intro
⌨️ HTML & CSS setup
⌨️ Basic JavaScript setup
⌨️ Object Oriented programming with JavaScript
⌨️ Creating Player and Game objects
⌨️ Animation loop
⌨️ Keyboard inputs
⌨️ Creating projectiles
⌨️ Periodic events
⌨️ Drawing game UI
⌨️ Base enemy class
⌨️ Collision detection between rectangles
⌨️ Drawing game score
⌨️ Win and lose condition
⌨️ Counting game time
⌨️ Animated parallax backgrounds
⌨️ Sprite animation with JavaScript
⌨️ Creating a debug mode
⌨️ Animating enemy sprite sheets
⌨️ Night Angler enemy class
⌨️ Lucky Fish enemy class
⌨️ Collecting power ups
⌨️ Drawing projectiles as images
⌨️ Custom fonts and game text
⌨️ Cleaning up
⌨️ Particle effects and physics
⌨️ Particle rotation
⌨️ Tweaks and fixes
⌨️ Hive Whale enemy class
⌨️ Drone enemy class
⌨️ Dust effect animation
⌨️ Fire effect animation
⌨️ Tuning game difficulty
⌨️ What to do next?

Taught by

freeCodeCamp.org

Reviews

Start your review of Code a 2D Game Using JavaScript, HTML, and CSS (w/ Free Game Assets) – Tutorial

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.