xxxxxxxxxx
64
var proton = {
x: 200,
y: 200,
// core: function(){
// noStroke(0);
// fill(255);
// ellipse (this.x,this.y, 15,15);
// },
// jitter: function (){
// this.x = 200 + random (-1,1);
// this.y = 200 + random (-1,1);
// }
};
function setup() {
createCanvas(400, 400);
}
function draw() {
background(0);
// proton.core();
// proton.jitter();
//stroke(255);
//line(200,0,200,400);
//electron orbit
stroke(255);
strokeWeight(3);
fill(0);
ellipse(200, 200, 200, 200);
//electron
push();
translate(200, 200);
rotate(frameCount / -80.0);
fill(255);
ellipse(100, 0, 20, 20);
pop();
// //proton
// push();
// translate(200, 200
// rotate(frameCount / 100.0);
// fill(255);
// ellipse(0, 0, 50, 52, 5);
// pop();
//function proton(){
noStroke();
fill(255);
ellipse (size.x, size.y, 15,15);
//}
//function protonMotion(){
size.x = 200 + random (-1,1);
size.y = 200 + random (-1,1);
//}
}