Share your repls and programming experiences

← Back to all posts
JavaScript Canvas Virus Animation
xxpertHacker (865)

Original source and author: https://codepen.io/curtlol/full/PpwNpR


Presenting this (heavily modified) browser JavaScript animation:

Virus Update

This would make for a pretty cool loading screen or screen saver, maybe for when you leave your computer and you've been idle for a few minutes.

I have heavily modified all 3 primary components of the original document, the HTML, the CSS, and the JavaScript.

The downloadable version is here.

Comments
hotnewtop
MatReiner (123)

type this into the console a few times:

walkers.push(...walkers)

if you don't think that's enough, try this:

while(1)location.reload(1)
xxpertHacker (865)

@MatReiner Wait, what? How'd you get the color?

MatReiner (123)

@StudentFires use ticks (`txt`) to get monospaced red: nice

xxpertHacker (865)

@MatReiner Oh, I didn't realize you did that, okay.

Thanks

AmazingMech2418 (1043)

Is this a random walker?

xxpertHacker (865)

@AmazingMech2418 Not too random, it can only move in units of 5. But yeah.

That's why it ends up making a grid, I ought to make that random too.

Also, it isn't a random walker, but 500 random walkers.

AmazingMech2418 (1043)

@StudentFires Though, it's great that you were able to create a multithreading (in a way) random walker system, allowing 500 random walkers at the same time! I'm guessing that for loops and either setInterval or requestAnimationFrame were used in this to loop through the for loops which go through iterating for each random walker...

xxpertHacker (865)

@AmazingMech2418 Yeah, a loop was used, but what comes after your ...?

You can just view the source code.

AmazingMech2418 (1043)

@StudentFires Nothing. LOL! I don't know why I'm suddenly using ellipses (as in plural of ellipsis which is ..., not plural of ellipse).

xxpertHacker (865)

@AmazingMech2418 Oh... I thought you had something to say, and I was interested in what it would've been, but oh well.

Btw, don't forget to upvote.