Toggle navigation
Explora
(current)
Aprende
Crea
Retos
×
Aspectos básicos
void main() {...}
for ( int i = 0 ; i < N ; i++ ) {...}
while (condición) {...}
do {...} while (condición);
if (condición) {...}
if (condición) {...} else {...}
switch (valor) {...}
Mostrar y pedir datos
print()
println()
readInteger()
readDouble()
readChar()
readString()
Funciones matemáticas
abs(n)
log(n)
sqrt(n)
pow(b,e)
floor(n)
ceil(n)
round(n)
sin(n)
cos(n)
tan(n)
asin(n)
acos(n)
atan(n)
random(n)
Funciones gráficas
point(x,y)
line(x1,y1,x2,y2)
ellipse(x,y,w,h)
rect(x,y,w,h)
triangle(x1,y1,x2,y2,x3,y3)
text(msg,x,y)
textWidth(msg)
textSize(n)
background(r,g,b,a)
strokeWeight(n)
stroke(r,g,b,a)
noStroke()
fill(r,g,b,a)
noFill()
image(url, x,y,w,h)
Nuevo
Ayuda
Probar
...
void nave(double x, double y, double escala) { int grosorAleron = round(2*escala); image ("http://3.bp.blogspot.com/-svS34E-XxjY/Tv9dd61xSxI/AAAAAAAAVsA/vXRbc7gwwMk/s1600/estrella49.gif", 0,0, 320,320); image ("https://ugc.kn3.net/i/origin/http://i158.photobucket.com/albums/t118/cancesevero/2_zps0916328b.png", 230,50, 200,200) ; strokeWeight(1); fill(179,101,171); rect(x-20*escala,y, 40*escala,10*escala); fill(255,0,157); noStroke(); ellipse(x,y, 10*escala,40*escala); ellipse(x-20*escala,y+5*escala, 5*escala,20*escala); ellipse(x+20*escala,y+5*escala, 5*escala,20*escala); stroke(0,225,255); strokeWeight(grosorAleron); line(x,y+5*escala, x,y+15*escala); } void dibuja () { background(10,45,96); double escala = 1; if (mouseY > 60) { escala = 1; } else { escala = 1; } nave(mouseX,250, escala); } void main() { animate(dibuja); }
Canvas not supported.
Programado por
iTsDaniiYT
0 votos
62 descargas
24 usos