Created
March 12, 2014 03:26
-
-
Save asquared/9500261 to your computer and use it in GitHub Desktop.
Much animation. Such keyer. wow.
This file contains 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
/* | |
* test of V8 keyer animation | |
*/ | |
({ | |
assets: [ | |
load_asset("/opt/exacore/test_files/doge.png"), | |
load_asset("/opt/exacore/test_files/such_keyer.png"), | |
load_asset("/opt/exacore/test_files/much_animation.png"), | |
load_asset("/opt/exacore/test_files/wow.png") | |
], | |
time : 0, | |
render : function() { | |
var time = this.time; | |
this.time += 0.02; | |
var r = 250; | |
var xc = 960; | |
var yc = 540; | |
var x0 = Math.floor(xc + r*Math.cos(time)) - 100; | |
var y0 = Math.floor(yc + r*Math.sin(time)) - 22; | |
var x1 = Math.floor(xc + r*Math.cos(time + 2.1)) - 140; | |
var y1 = Math.floor(yc + r*Math.sin(time + 2.1)) - 19; | |
var x2 = Math.floor(xc + r*Math.cos(time + 4.2)) - 38; | |
var y2 = Math.floor(yc + r*Math.sin(time + 4.2)) - 11; | |
draw(this.assets[0], 0, 0, 832, 387, 255, 306, 255); | |
draw(this.assets[1], 0, 0, x0, y0, 199, 43, 255); | |
draw(this.assets[2], 0, 0, x1, y1, 279, 34, 255); | |
draw(this.assets[3], 0, 0, x2, y2, 75, 22, 255); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment