Tutorial for beginners: interactive JS spritesheets without HTML5

6 comments · 82% upvoted · source · other discussions

comments

[deleted]

What the hell? This feels like a relic from the 90's but it's talking about HTML5 and shit.

spritesheet [OP]

Yes, the spritesheet method originated in the 80's.

HTML5 is mentioned once: "HTML5 is NOT required"

But I could not find any references to excrement...

trip16661

a bit offtopic, that sprite is creepy af.

9thHokageHimawari

Jump -> anything -> jump

Good job, you've beaten laws of physics.

spritesheet [OP]

you're right, it's a glitch.

[deleted]

[deleted]

spritesheet [OP]

You're right about the scope of variables - I have old bad habits from other programming languages.

I used onclick instead of a loop to keep the code as short as possible.

I don't understand your comments about reflow or querySelector. Please provide a code snippet and explain why it's better.