This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @param {number} frequency | |
| * @param {number} [duration] in seconds | |
| * @param {number} [wavetype] 0 (sine), 1 (triangle), 2 (saw), 3 (tan), 4 (noise) or 5 (square) | |
| * @param {volume} | |
| */ | |
| function beep (frequency, duration = 0.1, wavetype = 1, volume = .5) { | |
| sfx([, 0, frequency, 0.01, duration, 0.01, wavetype], 0, volume) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| litecanvas() | |
| framerate(1) | |
| draw() | |
| function draw() { | |
| cls(3) | |
| block = randi(10,100) | |
| for (let y = 0; y < H; y += block) { | |
| for (let x = 0; x < W; x += block) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| litecanvas({}) | |
| function draw() { | |
| cls(0) | |
| textfont("monospace") | |
| textalign("center", "middle") | |
| const dots = ".".repeat(wrap(T*1.5,0,5)+1) | |
| text(W/2, H/2, "LOADING\n"+dots) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //! Based on https://slicker.me/javascript/physics/physics_engine.htm | |
| // Vector utilities | |
| class Vec { | |
| constructor(x=0, y=0) { | |
| this.x = x; | |
| this.y = y; | |
| } | |
| add(v) { | |
| return new Vec(this.x + v.x,this.y + v.y); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| litecanvas({ | |
| width: 8*8, | |
| autoscale: 3 | |
| }) | |
| const p = { | |
| x: 0, | |
| y: 0, | |
| dx: 0, | |
| dy: 0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| litecanvas({}) | |
| let cards = [], sprites, opens = [], timer = 0, score = 0 | |
| const | |
| SIZE = 64, | |
| OFFSET = SIZE/1.5, | |
| CLOSED_CARD = paint(SIZE, SIZE, () => { | |
| cls(2) | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| litecanvas({}) | |
| function init() { | |
| framerate(1) | |
| } | |
| function draw() { | |
| cls(0) | |
| // linedash([10,5]) | |
| // circ(W/2, H/2, 150, 2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| litecanvas({ | |
| width: 320, | |
| autoscale: false | |
| }) | |
| let offset = 0 | |
| let pos = vec(10, 10) | |
| function tapped(x, y) { | |
| vecSet(pos, x, y) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let pos = {}, | |
| speed = 100, | |
| ts = 32, | |
| bg | |
| litecanvas({ | |
| width: 320, | |
| autoscale: 0 | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # BEGIN HOTLINK PROTECTION | |
| RewriteEngine on | |
| RewriteCond %{HTTP_REFERER} !^$ | |
| RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC] | |
| RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC] | |
| RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?bing.com [NC] | |
| RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yahoo.com [NC] | |
| RewriteRule \.(jpg|jpeg|png|gif|svg)$ - [NC,F,L] |
NewerOlder