Learn to Code Asteroids - Lesson 5 - Scaling Vector Graphics
Now that we've got our polygon collision detection working it's time to complete our asteroid explosion code. At the moment when we shoot an asteroid it simply disappears from the screen. In the real game large asteroids get broken down into two smaller asteroids which in turn get broken down into two even smaller asteroids which are then the ones that finally get destroyed.
We've already written the code that generates random vector asteroids so we need to work out an easy way to make this generate different sized asteroids. We'll do this using a scaling factor.
Once we got the scaling factor working we need to add some code that detects what size of asteroid was hit and then decides whether it gets broken into two new asteroids or destroyed. At this point we can also generate explosion sound effect and build up the player score.
This video is part of the beginners programming course for Asteroids which is my level II beginners coding course. If you're brand-new to coding make sure you try out my absolute beginners programming course where we'll build a complete version of Space Invaders from scratch.
https://www.youtube.com/playlist?list=PLvOT6zBnJyYF3FzmfXz2QXMA8xk7JHA_b
Don't forget to check out the project pages on my website where you can download the code for this lesson and get lots more hints and tips.
https://bytesnbits.co.uk/asteroids
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Learn to Code Asteroids - Lesson 5 - Scaling Vector Graphics», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.