Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var gameExit;
- function setup() {
- createCanvas(400, 400);
- gameExit = true;
- }
- function draw() {
- startScreen(); //Before entering game
- if(!gameExit){
- background(0,20,90);
- base();
- head();
- }
- }
- function mouseClicked(){
- gameExit = !gameExit;
- }
- function startScreen(){
- background(255);
- textSize(32);
- text("Click Anywhere to Play", 40, 50);
- }
- function base(){
- fill(10,200,40);
- stroke(100,20,40);
- strokeWeight(4);
- rect(50, height-height/8, width-100, height/8);
- }
- function head(){
- fill(255);
- stroke(0);
- ellipse(width/2, height/4, 100, 90);
- //eyes
- fill(0);
- ellipse(width/2-15, height/4 -10, 10, 10);
- ellipse(width/2+15, height/4-10, 10, 10);
- //nose
- fill(215, 123, 40);
- strokeWeight(1);
- triangle(width/2, height/4, width/2-10, height/4+20, width/2-10, height/4+5);
- }
Advertisement
Add Comment
Please, Sign In to add comment