Uploaded May 2026 | Updated September 2026, 1 week ago
Don't make your players throw their keyboards. In this episode, we fully implement invincibility frames (i-Frames) in our JavaScript 2D game. i-Frames are the short window of immunity after taking damage that prevents players from being instantly destroyed by overlapping hits. We also add a smooth blinking opacity animation using a sine wave to visually signal invincibility, and wire up a complete game over loop with a panel, sounds, and play again/quit buttons.
This is part of a full vanilla JavaScript game development series, where weāre building a reusable starter kit step by step: youtube.com/playlist?list=PLYElE_rzEw_tjnJ_5gzRw0ZM5HRn7AIS0&si=j53kz7v7JoN5dg1B
What we cover:
iFrame logic inside the takeDamage() method
Invincibility timer driven by delta time
Flickering opacity effect using Math.sin() and Math.abs()
isDead() helper and player died event system
Game over state, HUD hide, and panel display
Play Again and Quit button wiring
Resources:
Source code: code-laboratory.kit.com/f08d3d0aa8
Audio:
šµ player_hurt.mp3: frankslaboratory.co.uk/downloads/147/player_hurt.mp3
šµ game_over.mp3: frankslaboratory.co.uk/downloads/147/game_over.mp3
šµ mission_complete.mp3: frankslaboratory.co.uk/downloads/147/mission_complete.mp3
ā± Timestamps
00:00 What Are Invincibility Frames & Why They Matter
01:00 Source Code Checkpoint (P18)
01:31 iFrames: Logic, Timer & Blink Animation
06:58 Game Over Screen: State, Panel & Sound
11:15 Full Damage Pipeline Explained
13:31 What's Next?
If this series is helping you, a like really does help the channel grow and drop a comment telling me what style of game you'd like to build next: pixel art, hand-drawn, or something else entirely. I read every one.
Don't make your players throw their keyboards. In this episode, we fully implement invincibility frames (i-Frames) in our JavaScript 2D game. i-Frames are the short window of immunity after taking damage that prevents players from being instantly destroyed by overlapping hits. We also add a smooth blinking opacity animation using a sine wave to visually signal invincibility, and wire up a complete game over loop with a panel, sounds, and play again/quit buttons.
This is part of a full vanilla JavaScript game development series, where weāre building a reusable starter kit step by step: youtube.com/playlist?list=PLYElE_rzEw_tjnJ_5gzRw0ZM5HRn7AIS0&si=j53kz7v7JoN5dg1B
What we cover:
iFrame logic inside the takeDamage() method
Invincibility timer driven by delta time
Flickering opacity effect using Math.sin() and Math.abs()
isDead() helper and player died event system
Game over state, HUD hide, and panel display
Play Again and Quit button wiring
Resources:
Source code: code-laboratory.kit.com/f08d3d0aa8
Audio:
šµ player_hurt.mp3: frankslaboratory.co.uk/downloads/147/player_hurt.mp3
šµ game_over.mp3: frankslaboratory.co.uk/downloads/147/game_over.mp3
šµ mission_complete.mp3: frankslaboratory.co.uk/downloads/147/mission_complete.mp3
ā± Timestamps
00:00 What Are Invincibility Frames & Why They Matter
01:00 Source Code Checkpoint (P18)
01:31 iFrames: Logic, Timer & Blink Animation
06:58 Game Over Screen: State, Panel & Sound
11:15 Full Damage Pipeline Explained
13:31 What's Next?
If this series is helping you, a like really does help the channel grow and drop a comment telling me what style of game you'd like to build next: pixel art, hand-drawn, or something else entirely. I read every one.








![CSS Filters - SVG Turbulence Filter Animation [ CSS3 Creative Menu Hover Effects ] Squigglevision
Lets take a look at CSS filters, specifically SVG turbulence animation (and displacement map) which apply perlin noise effect to any HTML element. It can also be applied to HTML canvas so you can try to combine it with any of the canvas effects we created in previous videos. Lets create really cool CSS3 creative menu hover effects also known as Squigglevision.
I have used CSS filters before to create sticky liquid effect. To achieve that we first blur the elements and then we apply strong contrast to make the famous flowing goo effect.
Today I will show you how to rapidly iterate between 5 distortion states using turbulence and displacement map inline SVG filters and how to tweak the effect to create your own variations
There is a patented cartoon animation technique called Squigglevision and we will recreate it with CSS. It was used for shows like Dr Katz and it is a computer animation style, that is supposed to remind viewer of hand drawn animation sketches. It is characteristic by shaking squiggly lines even when the characters are standing still.
Squigglevision cartoon technique is much faster to produce than hand drawn animation, because its made using computer. The shaking lines are done by looping 5 slighly different images over and over.
Relevant links:
https://css-tricks.com/squigglevision-in-css-and-svg/
https://en.wikipedia.org/wiki/Squigglevision
https://en.wikipedia.org/wiki/Perlin_noise
If you want source code to my tutorials I have made some of my videos available on live coding platform Eversparked. You can watch my videos with LIVE browser preview and live code that can be copied and adjusted at any stage. I really like the project idea, I wish I had a tool like that when learning hot to code. Let me know what you think https://bit.ly/2Yxp7ia
You can message me on TWITTER https://twitter.com/code_laboratory
Check out some of my source code on CODEPEN https://codepen.io/franksLaboratory
For more creative CSS animation tutorials for beginners as well as advanced HTML & CSS guides, hover animation and transition examples from scratch with pure vanilla CSS, new experimental animations on buttons, menus, forms and other web elements, CSS animation examples, creative ideas for web design, advanced CSS selectors and the best CSS tricks of 2019, check out my CSS3 & HTML5 playlist:
https://www.youtube.com/watch?v=TbI7TFjlDbU&list=PLYElE_rzEw_t2O2DvfopIoq-diTgefVzV
I also have pure vanilla JavaScript animation series, in each tutorial we create all different kinds of interactive animated effects from scratch. No plugins, no libraries, no frameworks. Every line of code is explained to give you hands on experience and teach you as much JavaScript as possible. If you want more creative JavaScript tutorials, HTML canvas animations, interactive animated effects, code alongs, video guides for beginners as well as advanced pure vanilla JavaScript, check out the playlist here:
https://www.youtube.com/watch?v=afdHgwn1XCY&list=PLYElE_rzEw_siuo-kkHh5h7Sk 6IPYNh
If you liked this advanced CSS3 tutorial Im sure you will enjoy other videos on my channel. You can find HTML Canvas Animation Tutorials, JavaScript tutorials, animated effects and step by step animation guides, each video shows many examples of the final effect. I will help you learn modern web development techniques by building real projects you can show off on your personal website or GitHub. Code along with me and gain skills to get your first job in the industry. If I could do it you can do it too. If you decide to code along and modify the effects, share your Codepen/JS Fiddle in the comments, I want to see what you came up with.
My name is Frank, Im a self-taught Front End Web Developer. I learned everything I know in my free time and I used the knowledge to get a great job in web development industry. The part I enjoy the most is building creative animations and interactive effects for the web using HTML, CSS and JavaScript. Thank you for watching my video.
For more creative vanilla JavaScript tutorials, CSS tricks, HTML canvas animations, front end web development and web design guides, subscribe to the channel and click the bell icon to get notified when I release a new animation tutorial.
#css3 #html5 #frankslaboratory
Music:
Business / Corporate by Mixaund | https://mixaund.bandcamp.com
Music promoted by https://www.free-stock-music.com
The description of this video may contain affiliate links, which means that if you buy one of the products that I recommend, Ill receive a small commision without any additional cost for you. This helps to support the channel and allows me to continue making videos like this. Thank you for the support! CSS Filters - SVG Turbulence Filter Animation [ CSS3 Creative Menu Hover Effects ] Squigglevision](https://i.ytimg.com/vi/lisZT8JIeKk/mqdefault.jpg)

