• fullscreen
  • Termite_Group_3.pde
  • PImage wood1; //Declares attribute "wood1" as an image
    PImage wood2; //Declares attribute "wood2" as an image
    
    void setup() { //Start of void setup
      //Set size as 500 pixels by 500 pixels
      size (500,500);
      //Set background as wood1
      wood1 = loadImage("Wood1.jpg");
      background(wood1);  
    } //End of void setup
    
    void draw () { //Start of void draw
      //Line colour
      stroke(205,183,158,150);
      //Line thickness
      strokeWeight(10);
      //Have line follow mouse
      line(mouseX, mouseY, pmouseX, pmouseY);
      //Cursor as termite image
      PImage termite;
      if (mousePressed && (mouseButton == LEFT)){ //Start of IF statement
        termite = loadImage("termitedown.gif");
        cursor(termite);
      } //End of IF statement
      else{ // Start of ELSE statement
        termite = loadImage("termiteup.gif");
        cursor(termite);
      } //End of ELSE statement
    } //End of void draw
    
    void keyPressed() { //Start of void keyPressed
      //Reset background
      if(key == 'r' || key == 'R') { //Start of IF statement
      wood2 = loadImage("Wood2.jpg");
      background(wood2);
      } //End of IF statement
    } //End of void keyPressed
    

    code

    tweaks (0)

    about this sketch

    This sketch is running as Java applet, exported from Processing.

    license

    advertisement

    Claire D'All

    Termite_Group_3

    Add to Faves Me Likey@!
    You must login/register to add this sketch to your favorites.

    This is our Termite Eat Wood game which with movement of the mouse allows the termite to discolour the wood in its path.

    Click left button on mouse to flip the termite downwards.
    Click R button on keyboard to reset the background image.

    Created by Andrew Rae, Claire D'All, Kevin McDonald and Matt Hilley.

    Kevin McDonald
    19 Sep 2012
    I love the concept we came up with.

    It was a little bit of a shame we had no experience with Processing to get the end result we were aiming for, but then I guess that's the point.

    All in all, will be nice to revisit this in a few weeks and improve it.
    Claire D'All
    20 Sep 2012
    Disappointed that we didn't figure out how the rotate the termite in the direction it was moving, but hope to learn how to do this soon. The end result was great however.

    My contributions were referrencing to the coding for the project and applying parts of the code for the project.

    Agree with Kevin, looking forward to improving this project in a few weeks time.
    Claire D'All
    23 Sep 2012
    Thought this had already uploaded to the classroom file but just saw the button that said upload from your portfolio :(
    Kevin McDonald
    23 Sep 2012
    Oh, so we missed the deadline? I thought it was in the classroom also as that's where we went through to upload it. :/
    Claire D'All
    23 Sep 2012
    I don't know. I thought it was uploaded too but when I went on to the classroom page it wasn't there. I was only on my page. :(
    Kevin McDonald
    24 Sep 2012
    Its listed as being uploaded on the correct date, so should be fine. I'll see you tomorrow :)
    You need to login/register to comment.