add turtle triangle icon to end of drawing

This commit is contained in:
lee2sman 2021-01-21 04:53:14 -05:00
parent fe5f0c1c12
commit 4a9a70fc06
1 changed files with 11 additions and 0 deletions

View File

@ -3,6 +3,7 @@ function setup(){
createCanvas(windowWidth,windowHeight); //canvas is size of window
resetDefaults();
turtle();
displayTurtle();
}
function resetDefaults(){
@ -61,6 +62,16 @@ function randint(max=100){
//default returns int between 0 and 100
return int(random(max))
}
function displayTurtle(){
stroke(0,255,0);
strokeWeight(1);
fill(0,255,0);
push()
translate(x,y)
rotate(angle)
triangle(-10,10,10,10,0,-10);
pop()
}
function windowResized(){ //resizes canvas if window is resized
resizeCanvas(windowWidth, windowHeight);
}