Skip to content

Instantly share code, notes, and snippets.

@moziauddin
Created April 22, 2020 04:26
Show Gist options
  • Save moziauddin/9f00f7aa4dc8fd1348cd13a65325e6f0 to your computer and use it in GitHub Desktop.
Save moziauddin/9f00f7aa4dc8fd1348cd13a65325e6f0 to your computer and use it in GitHub Desktop.
Bullet Collision - Processing
void setup() {
size(400,400);
ellipseMode(CENTER);
}
void draw() {
background(255);
ellipse(mouseX,mouseY, 10,10);
ellipse(width/2, height/2, 100, 100);
line(mouseX, mouseY, width/2, height/2);
if(mousePressed) {
println(dist(mouseX, mouseY, width/2, height/2));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment