Primordial's public fiddles
-
Prime Circle
Testing a hypothesis: By placing a single pixel at a time along the circumference of a circle, and increasing the angle by a prime number, you fill every pixel along the circumference for the first 360 iterations of the loop. The only prime this doesn't work with is 3.
-
Fun with Particles
Click and drag to create particles. Left mouse button creates plane particles. Right mouse button creates missile particles. When a missile collies with a plane, the plane is destroyed and debris is created.
-
f7Cs4
No-Library (pure JS), HTML, CSS, JavaScript
-
OOJS.pt9
No-Library (pure JS), HTML, CSS, JavaScript
-
OOJS.pt8
This example adds a random class to each tile as it's created, and removes the tiles after they exit the screen boundaries.
-
OOJS.pt7
This example creates an init() function for our Tile and initializes the tile's velocity once when it's first created. It also adds a random multiplier to vX and vY so that each tile is moving at a different speed.
-
OOJS.pt6
This example adds another event handler to listen for the MouseMove event, and creates tiles when the mouse is moving, and a MouseDown event sets a flag to true beforehand.
-
一応Forked - OOJS.pt5
http://jsfiddle.net/PrimordialSoup/VXFJx/ この例では、30fpsで実行するアニメーションタイマーを微調整し、代わりにClickイベントのタイルを作成するMouseDownイベントおよびMouseUpイベントハンドラを実装しています。
-
OOJS.pt4
This example introduces more variables and functions to the Tile Class, and illustrates a way how each individual Object can use it's variables to calculate and update their own position with the "this" keyword.
-
OOJS.pt3
This example expands our Tile Class by adding a function which updates the tile. We also introduce a global variable PS, where we keep all of our global variables - like tiles, and screen width and height.
-
OOJS.pt2
This example introduces the Tile Class and presents a way to create Tile Objects, which keep their own unique x, y, and node variables.
-
OOJS.pt1
This example does not feature any OOJS, instead it illustrates how JavaScript variables, when used in a global scope, can potentially cause issues.