Created
October 29, 2011 22:20
-
-
Save bortels/1325166 to your computer and use it in GitHub Desktop.
messing with custom spritepack in Codify
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
watch("t") | |
watch("r") | |
watch("s") | |
watch("aa") | |
-- Use this function to perform your initial setup | |
function setup() | |
origin = vec2(1,0) | |
w2 = WIDTH/2 | |
h2 = HEIGHT/2 | |
v1= vec2(0,-1) | |
v2= vec2(0,1) | |
aa= v1:angleBetween(v2) | |
end | |
-- This function gets called once every frame | |
function draw() | |
background(63, 86, 106, 255) | |
t = vec2(CurrentTouch.x-w2, CurrentTouch.y-w2) | |
stroke(255, 0, 21, 255) | |
strokeWidth(5) | |
-- line(0,0,CurrentTouch.x,CurrentTouch.y) | |
r = math.deg(origin:angleBetween(t))-90 | |
translate(w2, h2) | |
rotate(r) | |
s=CurrentTouch.state | |
if (s == BEGAN) then | |
sound("shoot") | |
end | |
if (s ~= ENDED) then | |
line(0,0,0,1000) | |
end | |
sprite("Test:Su-37K_new") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment