Products
Features
YouTube Video Summarizer
Summarize YouTube videos
Web & PDF Highlighter
Highlight web pages & PDFs
Chat with PDF
Ask any PDF questions with AI
Ask AI Clone
Chat with your highlights & memories
Audio Transcriber
Transcribe audio files to text
Glasp Reader
Read and highlight articles
Kindle Highlight Export
Export your Kindle highlights
Idea Hatch
Hatch ideas from your highlights
Integrations
Obsidian Plugin
Notion Integration
Pocket Integration
Instapaper Integration
Medium Integration
Readwise Integration
Snipd Integration
Hypothesis Integration
Apps & Extensions
Chrome Extension
Safari Extension
Edge Add-ons
Firefox Add-ons
iOS App
Android App
Discover
Discover
Ideas
Discover new ideas and insights
Articles
Curated articles and insights
Books
Book recommendations by great minds
Posts
Essays and notes from readers
Quotes
Inspiring quotes collection
Videos
Curated videos and summaries
Explore Glasp
Glasp Newsletter
Weekly insights and updates
Glasp Talk
Interview series with great minds
Glasp Blog
Latest news and articles
Glasp Use Cases
Learn how others use Glasp
Build & Support
Glasp API
Access Glasp's API for developers
MCP Connector
Connect Glasp to Claude & ChatGPT
Community
Glasp Reddit Community
Students
Student discount and benefits
FAQs
Frequently Asked Questions
AboutPricing
DashboardLog inSign up

Coding Challenge #46.2: Asteroids with p5.js - Part 2

59.5K views
•
December 16, 2016
by
The Coding Train
YouTube video player
Coding Challenge #46.2: Asteroids with p5.js - Part 2

TL;DR

Adding lasers to destroy asteroids in a browser-based game coded with JavaScript using p5.js framework.

Transcript

welcome to part 2 of my asteroids coding challenge if you watch the previous one I have I had a ship and I had asteroids but no pew pew pew pew pew lasers so in this particular second part of the coding challenge I'm going to add the lasers which hit the asteroids and break them up into small pieces and don't forget if you're interested in a machin... Read More

Key Insights

  • 💥 Iterative development process with live coding demonstrates the addition of lasers and collision detection for asteroid destruction.
  • 🥳 Troubleshooting and bug fixes are integral parts of the coding challenge, highlighting the iterative nature of game development.
  • 👾 Collaboration with Suraj for machine learning bot training adds an exciting future aspect to the asteroid game.
  • 🤗 Coding challenges showcase incremental progress in game development, emphasizing hands-on learning and problem-solving skills.
  • 👾 Utilization of JavaScript and p5.js framework for browser-based game programming offers practical insights into web game development.
  • 💥 Balancing gameplay mechanics such as laser speed, asteroid break-up, and collision detection enhances the overall player experience.
  • 👾 Continuous improvement through feedback, testing, and refining game mechanics leads to a more engaging and polished game product.

Install to Summarize YouTube Videos and Get Transcripts

Explore YouTube Video Summarizer or Get YouTube Transcript Extractor

Questions & Answers

Q: What is the main focus of Part 2 of the asteroids coding challenge?

Part 2 focuses on adding lasers to the game to hit and break up the asteroids, enhancing gameplay dynamics.

Q: How does the laser creation process work in the coding challenge?

Lasers are created when the spacebar is pressed, originating from the ship's position and moving ten times faster, with each laser rendered as a point.

Q: How is collision detection implemented in the game for lasers and asteroids?

Collision detection is based on checking the distance between laser and asteroid positions, determining hits based on the proximity threshold.

Q: What additional feature is added at the end of the challenge to prevent the laser array from growing indefinitely?

An off-screen check function is implemented to remove lasers no longer visible on the screen, ensuring the array remains manageable during gameplay.

Summary & Key Takeaways

  • Part 2 of a coding challenge adding lasers to destroy asteroids in a browser game.

  • Lasers are implemented to hit and break up asteroids, with live coding challenges and troubleshooting.

  • Collaboration with Suraj for machine learning bot training on the asteroid game.


Read in Other Languages (beta)

English

Share This Summary 📚

Summarize YouTube Videos and Get Video Transcripts with 1-Click

Download browser extensions on:

Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator

Explore More Summaries from The Coding Train 📚

Classifying Poses with ml5.js Part 2 thumbnail
Classifying Poses with ml5.js Part 2
The Coding Train
ITP/IMA Winter Show 2019 thumbnail
ITP/IMA Winter Show 2019
The Coding Train
Coding Challenge #126: Toothpicks thumbnail
Coding Challenge #126: Toothpicks
The Coding Train
8.1: Fractals - The Nature of Code thumbnail
8.1: Fractals - The Nature of Code
The Coding Train
9.4: Genetic Algorithm: Looking at Code - The Nature of Code thumbnail
9.4: Genetic Algorithm: Looking at Code - The Nature of Code
The Coding Train
Text Generation using Spell with Nabil Hassein thumbnail
Text Generation using Spell with Nabil Hassein
The Coding Train

Summarize YouTube Videos and Get Video Transcripts with 1-Click

Download browser extensions on:

Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator

Apps & Extensions

  • Chrome Extension
  • Safari Extension
  • Edge Add-ons
  • Firefox Add-ons
  • iOS App
  • Android App

Key Features

  • YouTube Video Summarizer
  • Web & PDF Summarizer
  • Web & PDF Highlighter
  • Chat with PDF
  • Ask AI Clone
  • Audio Transcriber
  • Glasp Reader
  • Kindle Highlight Export
  • Idea Hatch

Integrations

  • Obsidian Plugin
  • Notion Integration
  • Pocket Integration
  • Instapaper Integration
  • Medium Integration
  • Readwise Integration
  • Snipd Integration
  • Hypothesis Integration

More Features

  • APIs
  • MCP Connector
  • Blog & Post
  • Embed Links
  • Image Highlight
  • Personality Test
  • Quote Shots

Company

  • About us
  • Blog
  • Community
  • FAQs
  • Job Board
  • Newsletter
  • Pricing
Terms

•

Privacy

•

Guidelines

© 2026 Glasp Inc. All rights reserved.