Battleships Recognize Impact In this example, we will establish a Boolean variable (true or false) to decide if the boat has been hit. Then, we will adjust.

Slides:



Advertisements
Similar presentations
Creative Computing. \\ aims By the end of the session you will be able to: 1.Move objects around 2.Write simple interactive programs 3.Use the mouse position.
Advertisements

Variables Conditionals Boolean Expressions Conditional Statements How a program produces different results based on varying circumstances if, else if,
Introducing Macromedia FreeHand MX
Introduction to Programming
Game with US Beginner Tutorial. Welcome!! Who I am What is Processing? Basic Coding Input Methods Images Classes Arrays.
A Quick Introduction to Processing
© Calvin College, Being abstract is something profoundly different from being vague... The purpose of abstraction is not to be vague, but to create.
Pong! “The oldest commercially available game in history” Resources created from the video tutorials provided by David Phillips on
 By carefully incrementing the X and/or Y values of our set of lines, we can create a game board for a boat game.  Lines that go from left to right are.
Tic Tac Toe size(600,600); Aim: How can we set up our canvas and display for a Tic Tac Toe game? 1. Sketch the two drawings and write the two code.
Microsoft® Small Basic Advanced Games Estimated time to complete this lesson: 1 hour.
Introduction to Animation Programming Our next set of exercises will look at animation on the following link:
Processing Processing is a simple programming environment that was created to make it easier to develop visually oriented applications with an emphasis.
What is iteration? I mean, what is iteration? Seriously, what is iteration?
FUNDAMENTALS OF PROGRAMMING SM1204 Semester A 2011.
Aim: Use the given examples to record examples and our own ideas in our journal 1.Write technical examples in journal and/or participate in full.
IAT 800 Lab 1: Loops, Animation, and Simple User Interaction.
1 Flash Actionscript Animation. 2 Introduction to Sprites We will now look at implementing Sprites in Flash. We should know enough after this to create.
PROCESSING Animation. Objectives Be able to create Processing animations Be able to create interactive Processing programs.
Responsive Battleships The battleship animation we created needs to respond to user input to be considered a game. The user will be able to launch an attack.
GameMaker.  A lot of Different Definitions  Easier to Say What is NOT a Game  Movie is Not a Game  No Active Participation  Final Outcome is Fixed.
Creating pong in scratch Learning objectives: To learn how to program Sensing via colour and sprite proximity O:\ICT\ks3\scratch\scratch Exercises\Creating.
Using Coordinate Geometry to Create Moving Images In unit 29 we created a simple drawing for the background of a children’s game. We are going to start.
Java Programming Khan Academy and Mrs. Beth Cueni.
FUNDAMENTALS OF PROGRAMMING SM1204 SEMESTER A 2012.
HTML, HTML5 Canvas, JavaScript PART 3 LOOKING MORE CLOSELY AT FULL BLOWN GAME DESIGN A PATTERNED BACKGROUND (CREATED WTIH LOOPS) WITH A MOVING OBJECT CHALLENGES.
Animating Coordinate Geometry In this unit we will expand upon our knowledge of using counters to create motion pictures. By using incremental mathematics,
Locally Edited Animations We will need 3 files to help get us started at
Game 1: Mr. Happy’s Quest For our original canvas, we had designed a child’s background using simple shapes. For this project, we will add objects that.
We will be creating a spaceship that simulates real movements in space. The spaceship will fire a laser beam that can destroy targets. The spaceship will.
KeyListener and Keyboard Events Just as we can implement listeners to handle mouse events, we can do the same for keyboard events (keypresses) –to implement.
Keyboard and Events. What about the keyboard? Keyboard inputs can be used in many ways---not just for text The boolean variable keyPressed is true if.
Processing Lecture.2 Mouse and Keyboard
KeyListener and Keyboard Events Another type of listener listens for keyboard entry – the KeyListener which generates KeyEvents –to implement KeyListener,
PAGES:51-59 SECTION: CONTROL1 : DECISIONS Decisions.
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 10 Fall 2010.
Creating Art With Simple Shapes By carefully implementing simple shapes to an HTML canvas we can create useful graphics. With enough time, lines, ellipses.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 02b: Tutorial for Programming in Processing Jarek Rossignac.
CIS 3.5 Lecture 2.2 More programming with "Processing"
Lesson Two: Everything You Need to Know
Arrays. An array is a collection “The Dinner offers an array of choices.” In computer programming, an array is a collection of variables of the same data.
Mouse Inputs in Processing. Interacting with the Mouse mouseX and mouseY: pg mouseXmouseY –The position of the mouse in the canvas pmouseX and.
Lesson Two: Everything You Need to Know
Animation Pages Function Function Definition Calling a function Parameters Return type and return statement.
______________________________________________________________________________________ SCHOOL OF INTERACTIVE ARTS + TECHNOLOGY [SIAT] |
Continuous. Flow of Control Programs can broadly be classified as being –Procedural Programs are executed once in the order specified by the code varied.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Processing  Install Processing  Learn how to edit, run, save, export,
Programming for Art: Arrays – 2D ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 16 Fall 2010.
Battleships. You need to know How to draw two 11 x 11 grids How to read off names of squares.
What is Computing? What can be Programmed? Creative Computing Processing Downloading Processing Dropbox Primitive Shapes – point – line – triangle – quad.
Review Random numbers mouseX, mouseY setup() & draw() frameRate(), loop(), noLoop() Mouse and Keyboard interaction Arcs, curves, bézier curves, custom.
Computer Science I Animations. Bouncing ball. The if statement. Classwork/homework: bouncing something. Compress and upload work to Moodle.
GAME:IT Paddle Ball Objectives: Review skills from Introduction Create a background Add simple object control (up and down) Add how to create a simple.
Creating a Simple Game in Scratch Barb Ericson Georgia Tech May 2009.
Variables. Something to mention… void setup(){ size(200, 200); background(255); smooth(); } void draw() { stroke(0); strokeWeight(abs(mouseX-pmouseX));
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Index Background Costumes Making object walk smoothly Controlling an object with the keyboard Control an object with the mouse Changing costume when hit.
Scratch for Interactivity
p5.js mouse, keyboard and if’s
Lesson Two: Everything You Need to Know
Chapter 7 Functions.
Chapter 7 Functions.
Chapter 10 Algorithms.
Mouse Inputs in Processing
Chapter 5, Conditionals Brief Notes
Chapter 10 Algorithms.
More programming with "Processing"
Chapter 10 Algorithms.
Chapter 4, Variables Brief Notes
Creating a Simple Game in Scratch
Presentation transcript:

Battleships Recognize Impact In this example, we will establish a Boolean variable (true or false) to decide if the boat has been hit. Then, we will adjust graphics to a hit. //keep track of the status of boat 3 var boat3Alive = true;

//change the color to black if boat 3 is not alive if(!boat3Alive) fill(0,0,0); if(mousePressed){ keyX = mouseX; keyY = mouseY; }

//change boat3Alive to false if the explosion is on the boat if(boomX > 350 && boomX 50 && boomY < ){ boat3Alive = false; }

Practice 1: 20% Use the examples given to have the boats change to a charred out husk after being destroyed by the player. Be sure to make all of the boats capable of being destroyed. Continue to improve on boat movement, the game functionality and aesthetics.

Review Battleships recognize Impact Code example Practice 1

Target for Pong Game Our game has previously enabled the ball to bounce around the sides of the screen and off the paddle. We will now add a target balloon for the ball to impact. var balloonX = 200; var balloonY = 200;

if (distance(x,y,balloonX,balloonY)<100){ balloonX = random(100,600); balloonY = random(100,600); }

fill(100,100,random(200,255)); ellipse(balloonX,balloonY,100,100); //disable game if ball gets below canvas if(y>700)b =0; keyX = mouseX;

Practice 2: 20% Apply the suggested changes to enable the mouse to move the paddle and the balloon to appear and reappear on impact. Using your own ideas, improve the game’s function and/or aesthetics to create a truly awesome online project.

Review Target for Pong Game Code example Practice 2

Hugmaster 5000 Recognize Collisions For this practice, we will expand on our previous stick figure program to enable one of the characters to respond to a close proximity of the user controlled character. var blueRangerX = 700; var blueRangerY = 200;

//enable the mouse with previous established variables keyX = mouseX-200; keyY = mouseY-200; //respawn the blue ranger if press mouse near it if(mousePressed && distance(keyX+200,keyY+200,blueRangerX,blu eRangerY)<100){ blueRangerX = random(100,1000); blueRangerY = random(0,400); }

//THE BLUE RANGER stroke(0,0,255); //body line(blueRangerX+yHand,blueRangerY + 40,blueRangerX+yHand,blueRangerY + 140); //head ellipse(blueRangerX+yHand,blueRangerY,80+yHand,80); //legs line(blueRangerX+yHand,blueRangerY + 140,blueRangerX -30 +yHand,blueRangerY + 260); line(blueRangerX+yHand,blueRangerY + 140,blueRangerX + 30+yHand,blueRangerY + 260); //upper arms line(blueRangerX+yHand,blueRangerY + 40,blueRangerX -30- yHand,blueRangerY yHand); line(blueRangerX+yHand,blueRangerY + 40,blueRangerX yHand,blueRangerY yHand);

Assignment 3: 20% Use the examples shown to enable a stickfigure to respawn when the mouse is clicked and the player’s stickfigure is close. Improve functionality such as make other figures also respond if clicked on. Improve aesthetics such as showing the hug, better colors, better figure limbs and general improvements on graphics.

Review Hugmaster 5000 Recognize Collisions Code Example Assignment 3 20%

var targetX = 50; var targetY = 225; //respawn if spaceship get space happy if(distance(targetX,targetY,mouseX,275) <70){ targetX = random(20,500); } //don’t forget to copy the distance function

//UFO noStroke(); fill(100,100,100); ellipse(mouseX + 25,275,100,100); fill(50,50,50); ellipse(mouseX + 50,325,50,50); ellipse(mouseX,325,50,50); fill(50,75,50); quad(mouseX+125,325,mouseX+75,275,mouseX - 25,275,mouseX-75,325); fill(100,100,100); text("USS Gabrielle",mouseX-10,300);

//mr space happy target fill(100,100,255); ellipse(targetX,targetY,50,50); fill(0,0,0); ellipse(targetX-10,targetY-15,5,5); ellipse(targetX+10,targetY-15,5,5); ellipse(targetX,targetY+5,25,25); fill(100,100,255); rect(targetX-20,targetY-10,35,12);

Practice 4: 20% Use the example code create a spaceship that responds to the mouse and a happy space smiley. Expand on the example and enable the space smile and ship to go all around the canvas. Introduce student designed functional and aesthetic improvements to make the game awesome.

Review code example Practice 4

Battleship Improvements Make ALL the boats respond to the explosion Start the variable explosion off the screen Have the color of a destroyed ship more interesting than black Have sunk ships respawn after time

Paddleball Game Improvements Have more colorful objects in the game Have more than one target balloon Improve the background with awesome graphics Make something better happen when the player looses

Stick Figure Improvement Have the stick figures reappear when clicked on Make all the figures different colors Make the figures look more realistic Decorate the background with something interesting

Space Adventure Improvement Make the target and the space ship move to other places on the screen Add other stellar stuff such as other ships, comets, asteroids etc. Improve the ship graphic to look more realistic Give the ship LASERS!

Review Battleship Improvement Paddleball Improvement Stick figure improvement Space adventure improvement

Gabrielle's Games size(500,500); var a = 1; var b = 1; var x = 60; var y = 60; var w =.1; var t =.1; var keyX = 100; var keyY = 200; var boomX = 100; var boomY = 100; void draw(){ background(64,224,208); stroke(0,0,0); strokeWeight(1); //horizontal grid line(0,50,800,50); line(0,100,800,100); line(0,150,800,150); line(0,200,800,200); line(0,250,800,250); line(0,300,800,300); line(0,350,800,350); line(0,400,800,400); line(0,450,800,450); line(0,500,800,500); //vertical grid line(50,0,50,800); line(100,0,100,800); line(150,0,150,800); line(200,0,200,800); line(250,0,250,800); line(300,0,300,800); line(350,0,350,800); line(400,0,400,800); line(450,0,450,800); line(500,0,500,800); //boat 3 strokeWeight(3); stroke(205,205,0); fill(255,255,0); rect(350,50,30,150); //boat 4 strokeWeight(3); stroke(0,205,0); fill(0,255,0); rect(300,350,150,30); //boat 5 strokeWeight(3); stroke(0,205,205); fill(0, 255, 255); rect(250,180,30,150); //boat 6 strokeWeight(3); stroke(0,0,205); fill(0,0,255); rect(320,260,150,30); //boat 7 strokeWeight(3); stroke(78,0,78); fill(128, 0, 128); rect(160,100,30,150); //boat 8 strokeWeight(3); stroke(205,142,153); fill(255,192,203); rect(30,270,150,30); //moving boats strokeWeight(3); stroke(205,0,0); fill(255,0,0); rect(x,y,30,150); if (x < 300) x = x + a; if (x > 299) y = y + b; if (y > 200) y = 200; strokeWeight(3); stroke(205,115,0); fill(255,165,0); rect(x,y,150,30); if (x < 300) x = x + a; if (x > 299) y = y + b; if (y > 200) y = 200; //explosions noStroke(); fill(255,0,0); ellipse(350,350,w*40,w*40); fill(255,165,0); ellipse(350,350,w*30,w*30); fill(255,255,0); ellipse(350,350,w*20,w*20); w = w + t; if (w>2) t = -t; if (w<.2) t = -t; noStroke(); fill(255,0,0); ellipse(350,100,w*30,w*30); fill(255,165,0); ellipse(350,100,w*20,w*20); fill(255,255,0); ellipse(350,100,w*10,w*10); w = w + t; if (w>2) t = -t; if (w<.2) t = -t; noStroke(); fill(255,0,0); ellipse(boomX, boomY,w*60,w*60); fill(255,165,0); ellipse(boomX, boomY,w*40,w*40); fill(255,255,0); ellipse(boomX, boomY,w*20,w*20); w = w + t; if (w>2) t = -t; if (w<.2) t = -t; //show target designator stroke(random(1,150),0,0); strokeWeight(3); line(keyX-30,keyY,keyX+30,keyY); line(keyX,keyY-30,keyX,keyY+30); } void keyPressed() { if (keyCode == UP) keyY = keyY - 15; if (keyCode == DOWN) keyY = keyY + 15; if (keyCode == LEFT) keyX = keyX - 15; if (keyCode == RIGHT) keyX = keyX + 15; if (keyCode == "32") { boomX = keyX; boomY = keyY; } } size(700, 700); background(100,255,255); stroke(255,255,255); strokeWeight(1); var x = 100; var y = 100; var a = 15; var b = 15; var keyX = 550; var t = ""; void draw(){ background(100,255,255); x = x + a; y = y + b; if (x >= 640) a = -a + (random(-50,50))/30; if (x <= 60) a = -a; if (y >= 640 && x > keyX && x < keyX +250) { y=630; b = -b; } if(y>640)t = t + "you lost!"; if (y <= 60) b = -b; fill(random(1,255),255,255); ellipse(x,y,120,120); fill(0,0,250); ellipse(x,y,100,100); fill(0,0,200); ellipse(x,y,80,80); fill(0,0,150); ellipse(x,y,60,60); fill(0,0,100); ellipse(x,y,40,40); fill(0,0,50); ellipse(x,y,20,20); fill(50,50,50); rect(keyX,680,250,20); text(t,50,50); } void keyPressed() { if (keyCode == LEFT) keyX = keyX - 100; if (keyCode == RIGHT) keyX = keyX + 100; if (keyCode == "32") { } size(1100, 600); var xAll = 0; var yHand = 0; var t=-1; var keyX =0; var keyY = 0; void draw(){ if (xAll < 500) xAll = xAll + 5; if (xAll >= 500) yHand = yHand + t; if (yHand >= 30) t = -t; if (yHand <= 0) t = -t; stroke(255,0,0); strokeWeight(5); background(100,100,100); //body line(200-yHand+keyX,240+keyY,200-yHand+keyX,340+keyY); //head ellipse(200-yHand+keyX,200+keyY,80-yHand,80); //legs line(200-yHand+keyX,340+keyY,170-yHand+keyX,460+keyY); line(200-yHand+keyX,340+keyY,230-yHand+keyX,460+keyY); //upper arms line(200-yHand+keyX,240+yHand+keyY,170+keyX,300-yHand+keyY); line(200-yHand+keyX,240+yHand+keyY,225+keyX,300-yHand+keyY); stroke(255,165,0); //body line(300-yHand,240,300-yHand,340); //head ellipse(300-yHand,200,80-yHand,80); //legs line(300-yHand,340,270-yHand,460); line(300-yHand,340,330-yHand,460); //upper arms line(300-yHand,240,270+yHand,300-yHand); line(300-yHand,240,325+yHand,300-yHand); stroke(255,255,0); //body line(400,240,400-yHand,340); //head ellipse(400,200,80-yHand,80); //legs line(400-yHand,340,370-yHand,460); line(400-yHand,340,430-yHand,460); //upper arms line(400,240,370+yHand,300-yHand); line(400,240,425+yHand,300+yHand); stroke(0,255,0); //body line(500,240,500-yHand,340); //head ellipse(500,200,80-yHand,80); //legs line(500-yHand,340,470-yHand,460); line(500-yHand,340,530-yHand,460); //upper arms line(500,240,470+yHand,300+yHand); line(500,240,525+yHand,300-yHand); stroke(0, 255, 255); //body line(600+yHand,240,600+yHand,340); //head ellipse(600+yHand,200+yHand,80+yHand,80); //legs line(600+yHand,340,570+yHand,460); line(600+yHand,340,630+yHand,460); //upper arms line(600+yHand,240+yHand,570-yHand,300-yHand); line(600+yHand,240+yHand,625-yHand,300-yHand); stroke(0,0,255); //body line(700+yHand,240,700+yHand,340); //head ellipse(700+yHand,200,80+yHand,80); //legs line(700+yHand,340,670+yHand,460); line(700+yHand,340,730+yHand,460); //upper arms line(700+yHand,240,670-yHand,300-yHand); line(700+yHand,240,725-yHand,300-yHand); stroke(128, 0, 128); //body line(800+yHand,240,800+yHand,340); //head ellipse(800+yHand,200,80+yHand,80); //legs line(800+yHand,340,770+yHand,460); line(800+yHand,340,830+yHand,460); //upper arms line(800+yHand,240+yHand,770,300-yHand); line(800+yHand,240+yHand,825,300-yHand); stroke(255,192,203); //body line(900+yHand,240,900+yHand,340); //head ellipse(900+yHand,200,80+yHand,80); //legs line(900+yHand,340,870+yHand,460); line(900+yHand,340,930+yHand,460); //upper arms line(900+yHand,240+yHand,870,300-yHand); line(900+yHand,240+yHand,925,300-yHand); } void keyPressed() { if (keyCode == LEFT) keyX = keyX - 50; if (keyCode == RIGHT) keyX = keyX + 50; if (keyCode == UP) keyY = keyY - 50; if (keyCode == DOWN) keyY = keyY + 50; if (keyCode == "32") { } size(800,515); var t =.01 var x = 1.0; void draw(){ background(10,10,10); x = x - t; if(x < 0.0) t = -t; if(x > 1.0) t = -t; //stars stroke(random(1,255),random(1,255),random(1,255)); fill(random(1,255),random(1,255),random(1,255)); ellipse(random(1,800),random(1,500),1,1); stroke(random(1,255),random(1,255),random(1,255)); fill(random(1,255),random(1,255),random(1,255)); ellipse(random(1,800),random(1,500),1,1); stroke(random(1,255),random(1,255),random(1,255)); fill(random(1,255),random(1,255),random(1,255)); ellipse(random(1,800),random(1,500),1,1); stroke(random(1,255),random(1,255),random(1,255)); fill(random(1,255),random(1,255),random(1,255)); ellipse(random(1,800),random(1,500),1,1); stroke(random(1,255),random(1,255),random(1,255)); fill(random(1,255),random(1,255),random(1,255)); ellipse(random(1,800),random(1,500),1,1); stroke(random(1,255),random(1,255),random(1,255)); fill(random(1,255),random(1,255),random(1,255)); ellipse(random(1,800),random(1,500),1,1); stroke(random(1,255),random(1,255),random(1,255)); fill(random(1,255),random(1,255),random(1,255)); ellipse(random(1,800),random(1,500),1,1); stroke(random(1,255),random(1,255),random(1,255)); fill(random(1,255),random(1,255),random(1,255)); ellipse(random(1,800),random(1,500),1,1); stroke(random(1,255),random(1,255),random(1,255)); fill(random(1,255),random(1,255),random(1,255)); ellipse(random(1,800),random(1,500),1,1); stroke(random(1,255),random(1,255),random(1,255)); fill(random(1,255),random(1,255),random(1,255)); ellipse(random(1,800),random(1,500),1,1); stroke(random(1,255),random(1,255),random(1,255)); fill(random(1,255),random(1,255),random(1,255)); ellipse(random(1,800),random(1,500),1,1); stroke(random(1,255),random(1,255),random(1,255)); fill(random(1,255),random(1,255),random(1,255)); ellipse(random(1,800),random(1,500),1,1); stroke(random(1,255),random(1,255),random(1,255)); fill(random(1,255),random(1,255),random(1,255)); ellipse(random(1,800),random(1,500),1,1); stroke(random(1,255),random(1,255),random(1,255)); fill(random(1,255),random(1,255),random(1,255)); ellipse(random(1,800),random(1,500),1,1); stroke(random(1,255),random(1,255),random(1,255)); fill(random(1,255),random(1,255),random(1,255)); ellipse(random(1,800),random(1,500),1,1); stroke(random(1,255),random(1,255),random(1,255)); fill(random(1,255),random(1,255),random(1,255)); ellipse(random(1,800),random(1,500),1,1); stroke(random(1,255),random(1,255),random(1,255)); fill(random(1,255),random(1,255),random(1,255)); ellipse(random(1,800),random(1,500),1,1); stroke(random(1,255),random(1,255),random(1,255)); fill(random(1,255),random(1,255),random(1,255)); ellipse(random(1,800),random(1,500),1,1); stroke(random(1,255),random(1,255),random(1,255)); fill(random(1,255),random(1,255),random(1,255)); ellipse(random(1,800),random(1,500),1,1); stroke(random(1,255),random(1,255),random(1,255)); fill(random(1,255),random(1,255),random(1,255)); ellipse(random(1,800),random(1,500),1,1); stroke(random(1,255),random(1,255),random(1,255)); fill(random(1,255),random(1,255),random(1,255)); ellipse(random(1,800),random(1,500),1,1); stroke(random(1,255),random(1,255),random(1,255)); fill(random(1,255),random(1,255),random(1,255)); ellipse(random(1,800),random(1,500),1,1); stroke(random(1,255),random(1,255),random(1,255)); fill(random(1,255),random(1,255),random(1,255)); ellipse(random(1,800),random(1,500),1,1); stroke(random(1,255),random(1,255),random(1,255)); fill(random(1,255),random(1,255),random(1,255)); ellipse(random(1,800),random(1,500),1,1); stroke(random(1,255),random(1,255),random(1,255)); fill(random(1,255),random(1,255),random(1,255)); ellipse(random(1,800),random(1,500),1,1); //sun noStroke(); fill(255,255,00); ellipse(400,255,100,100); //planet orbits noFill(); stroke(255,255,255); ellipse(400,255,x*200,150); //x is a percentage ellipse(400,255,(1-x)*250,200); //opposite path of other orbit ellipse(400,255,x*300,250); ellipse(400,255,(1-x)*350,300); ellipse(400,255,x*400,350); ellipse(400,255,(1-x)*450,400); ellipse(400,255,x*500,450); ellipse(400,255,(1-x)*550,500); //planets noStroke(); fill(255,0,0); ellipse(400-x*100,255,15,15); fill(255,165,0); ellipse(525-x*125,255,20,20); fill(205,205,0); ellipse(400+x*150,255,25,25); fill(0,255,0); ellipse(225+x*175,255,15,15); fill(0,255,255); ellipse(400-x*200,255,20,20); fill(0,0,255); ellipse(625-x*225,255,25,25); fill(128,0,128); ellipse(400+x*250,255,30,30); fill(255,192,203); ellipse(125+x*275,255,35,35); //UFO noStroke(); fill(100,100,100); ellipse(125+x*700,275,100,100); fill(50,50,50); ellipse(150+x*700,325,50,50); ellipse(100+x*700,325,50,50); fill(50,75,50); quad(225+x*700,325,175+x*700,275,75+x*700,275,25+x*700,325); } void keyPressed() { if (keyCode == LEFT) keyX = keyX - 50; if (keyCode == RIGHT) keyX = keyX + 50; if (keyCode == UP) keyY = keyY - 50; if (keyCode == DOWN) keyY = keyY + 50; if (keyCode == "32") { } CLICK HERE TO SEE MY OTHER PROJECTS