Created
November 17, 2013 18:02
-
-
Save CodeaLuis/7516145 to your computer and use it in GitHub Desktop.
Codea Project Gist Created with AutoGist
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
AutoGist Tab Order Version: 2.2.8 | |
------------------------------ | |
This file should not be included in the Codea project. | |
#Main |
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
VERSION = "2.2.8" --Do not edit this | |
PROJECTNAME = "AutoGist" --Do not change this, your project should be named AutoGist | |
--/* | |
BUILD = false | |
--The name of the project must match your Codea project name if dependencies are used. | |
--Project: Fisics , Edge , letters | |
--Version: Beta 1.0.0 | |
--Comments: | |
-- palabras | |
displayMode(FULLSCREEN) | |
-- Use this function to perform your initial setup | |
function setup() | |
caracteres = {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","L","O", | |
"1","2","3","4","5","6","7","8","9"} | |
objetos = {} | |
--creamos las paredes | |
pared_1 = physics.body(EDGE,vec2(0,0), | |
vec2(WIDTH,0)) --PARED DE ABAJO (BUTTON) | |
pared_2 = physics.body(EDGE,vec2(0,0), | |
vec2(0,HEIGHT)) --PARED IZQUIERDA | |
pared_3 = physics.body(EDGE,vec2(WIDTH,HEIGHT), | |
vec2(0,HEIGHT)) --PARED DE | |
pared_4 = physics.body(EDGE,vec2(WIDTH,0) | |
,vec2(WIDTH,HEIGHT)) | |
fontSize(40) | |
contador = 0 | |
end | |
-- This function gets called once every frame | |
function draw() | |
fill (0,0,44,199) | |
rect (0,0,WIDTH,HEIGHT) | |
contador = contador + 1 | |
if contador >= 20 then | |
cambioLetra = true | |
contador = 0 | |
else | |
cambioLetra = false | |
end | |
fill(255, 255, 255, 255) | |
for i,v in ipairs(objetos) do | |
if cambioLetra == true then | |
v.obtener = caracteres[math.ceil(math.random(1,#caracteres))] | |
end | |
pushMatrix() | |
translate(v.x,v.y) | |
rotate(v.angle) | |
text(v.obtener,0,0) | |
popMatrix() | |
end | |
end | |
function touched (t) | |
fill(232, 229, 229, 255) | |
table.insert(objetos,physics.body(CIRCLE,17)) | |
objetos[#objetos].x = t.x | |
objetos[#objetos].y = t.y | |
objetos[#objetos].restitution = 1 | |
objetos[#objetos].obtener = caracteres[math.ceil(math. | |
random(1,#caracteres))] | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment