DEV Community

Cover image for Build a Simple Arcade Game With Vanilla JavaScript - DOM Manipulation🚀

Build a Simple Arcade Game With Vanilla JavaScript - DOM Manipulation🚀

Roberto Hernandez on February 26, 2020

Originally published on my blog MullinStack Today’s a special day for those who just are starting out in the JavaScript world. The only way to mas...
Collapse
 
scrabill profile image
Shannon Crabill •

Fun! This is a good example of what seems complex, is relatively straightforward when the concept/requirements are broken down into individual functions.

Collapse
 
blindfish3 profile image
Ben Calder •

Fun. My only suggestion would be to store the score as a variable in the code rather than in the DOM. Once an application grows, storing values in the DOM is a surefire way to generate hard to trace bugs.

Collapse
 
blarzhernandez profile image
Roberto Hernandez •

Yes you're right. The idea is playing with the DOM at first. Thanks for sharing!

Collapse
 
devpato profile image
Pato •

The cover image is such a click bait lol

Collapse
 
blarzhernandez profile image
Roberto Hernandez •

Sorry, I had any intention.😀 thanks for reading! 😀

Collapse
 
zaimazhar profile image
zaimazhar •

Hi.

Cool post but any more further explanation on why not using data attributes when working with data instead of id?

Thanks.

Collapse
 
blarzhernandez profile image
Roberto Hernandez •

Love it. Thanks for sharing

Collapse
 
jlrxt profile image
Jose Luis Ramos T. •

Gracias

Collapse
 
johndavemanuel profile image
John Dave Manuel •

It would be better if the duck is "moving" inside the background only :)

Collapse
 
blindfish3 profile image
Ben Calder •

I think you just set yourself a challenge :P