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
// datos: constantes y variables | |
var pantera = new Avatar("pantera"); | |
var ardilla = new Avatar("squirrel"); | |
ardilla.scale(0.5); // cambia tamaño ardilla | |
ardilla.rotate(1, 45); // gira hombro izq | |
ardilla.rotate(2, 80); // gira codo izq | |
var draw = function() { |
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
var sr = new Avatar("squirrel"); | |
var x=0, y=0; | |
var up=true, pause=false; | |
var draw = function() { | |
background(255); | |
if ( up && sr.getAngle(1)<120 ) { | |
sr.rotate(1, 1); | |
sr.rotate(3, -1); | |
} else { |
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
// 0.2 - obj json | |
var pausa = false; | |
var av = new Avatar('squirrel'); | |
var x = { | |
minValue: 0, | |
maxValue: 400, | |
value: 200, | |
dir: true, |
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
//: ## MDP API | |
/*: | |
Identificador para cada articulación | |
(Xcode Playground notation) | |
- Cabeza - value 0 | |
- BrazoIzq - value 1 | |
*/ |
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
//: # La Guía de Swift | |
//: ## Por Alberto Pacheco | |
//: ### alberto@acm.org, Junio 2015 (ver. 1.2) | |
//: ----- | |
//: ## 1.1 MI PRIMER PROGRAMA | |
//: Como dicta la tradición, tu primer programa en Swift | |
//: sirve para imprimir **"Hola Mundo!"** solo se | |
//: requiere **una línea** para escribir este programa: | |
println("Hola Mundo!") | |
//: A diferencia de otros lenguajes, como Java y C/C++, **no** es necesario: |
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
// Monster 1 | |
PShape cara, ojo1, ojo2, boca; | |
PShape createBoca() { | |
PShape s = createShape(); | |
s.beginShape(TRIANGLE_STRIP); | |
s.fill(255); | |
s.stroke(0); | |
s.vertex(30, 75); |
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
public class AvatarFace { | |
PShape cara; | |
PShape ojoIzq, ojoDer; | |
PShape boca; | |
/* | |
public enum Action { | |
CerrarOjo, | |
AbrirOjo | |
} |
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
var av = new Avatar('squirrel'); | |
av.scale(0.25); | |
//frameRate(30); | |
var x = 0; | |
var y = 0; | |
var izqDer = true; | |
var arrAbajo = true; | |
var pausa = false; | |
var draw = function() { |
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
var pause = false; | |
noCursor(); | |
smooth(); | |
var clearBackground = function(r,g,b,a) { | |
fill(r,g,b,a); | |
noStroke(); | |
rect(0,0,400,400); | |
}; |
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
var av = new Avatar('squirrel'); | |
var sec = 0; | |
var fondo = color(200); | |
var draw = function() { | |
background(fondo); | |
for (var i=0; i<10; i++) { | |
av.rotate(i,random(-10,10)); | |
} | |
av.draw(mouseX,200); |