Matthew Soto Midterm Proposal Re-post

When ask to come up with an idea for my midterm I wasn’t sure what to create. So I decided to make landscape of a city. The reason I chose to do a city landscape is because in the city there is so much I can do. For example have cars moving and stop at the stop light, people moving, and then make look bright like new york city. My goal for this project is to give people a sense of how living in the city looks like and how it looks in the day time and at night. In order to accomplish this I must put in the code to have people moving and some going up and the others going down. I also need a code to freeze the car as well as have the street light change from red to green. In terms of external images being used I can use it for billboards and signs of some of the businesses and even the back drop for night and day.

Posted in Uncategorized | Leave a comment

Midterm

For the midterm project I want to make a fruit tree that dropped fruit and as the fruit dropped you would have to catch it with a basket. The tree was suppose to have red, green, and yellow apples and each color gave a certain amount points. You had a minute to catch as much fruit as you can. The score would show at the top of the screen as well as how much you missed and caught. I also thought about making levels for it so the apples fall at a faster rate and also “rotten” apples would fall from the tree and lower your score. For the project I was only able to make the tree,apples,basket. I made one “fruit” fall and the basket move side to side as plan. During the project I struggled with getting all the fruit to fall and testing to see if the fruit landed inside the basket. I had trouble with the timer and score and loading more than one image. Other than that I was pleased with my project and I hope to continue with it for the final.

-P.S I know this is late but as I said in one of the emails I sent you I do not have a computer at home at the moment but will soon hopefully.

PImage myImage; //PImage myImage2; int spacing= 60; int ballX= 30; int ballY= 100; int SpeedX= 0; int SpeedY= 5; int freeze =100 ; void setup(){ //  background(18,119,224);   size(600,600); myImage= loadImage(“redapple.gif”); } //myImage2= loadImage(“basket.gif”);

void draw(){    background(18,119,224);   //image(myImage,mouseX,mouseY,300,200);   if(ballX < 0 || ballX >width) SpeedX = SpeedX;   if(ballY > height) ballY = freeze;   //image(myImage,200,300,20,20);   //background(18,119,224);   //ellipse(ballX,ballY,20,20);   //ballX += SpeedX;   //ballY += SpeedY;   //rect(mouseX,height-10,100,10);   noStroke();// no black outline fill(103,65,19);// brown trunk rect(200,200,200,600); noStroke();// no black outline fill(19,103,38);// green leaves ellipse(width/2,height/4.2,600,272);// green circle fill(255,255,255);   for(int x=30; x<width; x=x + spacing)   {    for(int y=100; y<height/3.5; y = y + spacing)     {          //fill(int(map(y,0,height,255,225)));       ellipse(x,y,20,20);       fill(255,0,0);          }   } //if(ballX < 0 || ballX >width) SpeedX = SpeedX; ellipse(ballX,ballY,20,20); //image(myImage,18,87,30,30);   ballX += SpeedX;   ballY+= SpeedY; fill(206,134,67);   rect(mouseX,height-10,70,10);
image(myImage,17,84,30,30); image(myImage,70,84,30,30); image(myImage,130,84,30,30); image(myImage,190,84,30,30); image(myImage,250,84,30,30); image(myImage,310,84,30,30); image(myImage,370,84,30,30); image(myImage,440,84,30,30); image(myImage,500,84,30,30); image(myImage,550,84,30,30); image(myImage,17,145,30,30); image(myImage,75,145,30,30); image(myImage,140,145,30,30); image(myImage,200,145,30,30); image(myImage,260,145,30,30); image(myImage,320,145,30,30); image(myImage,380,145,30,30); image(myImage,440,145,30,30); image(myImage,500,145,30,30); image(myImage,560,145,30,30); }

 

Posted in Uncategorized | Leave a comment

PImage myImage;
int a = 100;
int b = 100;
int mouseClicks = 0;
int ellipseX1;
int ellipseY1;
int ellipseX2;
int ellipseY2;
int ellipseX3;
int ellipseY3;
int ellipseX4;
int ellipseY4;
int ellipseX5;
int ellipseY5;
int rectX1;
int rectY1;
int rectX2;
int rectY2;
int rectX3;
int rectY3;
int rectX4;
int rectY4;
int x = 0;
int y = 0;
/*boolean testRect1 = false;
boolean testRect2 = false;
boolean testRect3 = false;*/
boolean player1win = false;
boolean player2win = false;
int drawRect1;
int drawRect2;
int drawRect3;
int drawRect4;
int drawRect5;
int drawRect6;
int drawRect7;
int drawRect8;
int drawRect9;

void setup(){
size(600, 600);
background(77, 50, 191);
tint(0, 153, 204, 126);
myImage = loadImage("processing.jpg");
}
void draw(){
background(77, 50, 191);
smooth();
strokeWeight(3);
fill(0);
drawCell1();
drawCell2();
drawCell3();
drawCell4();
drawCell5();
drawCell6();
drawCell7();
drawCell8();
drawCell9();

image(myImage, 401, 401, 198, 198);

/*testRect1();
testRect2();
testRect3();
testRect4();
testRect5();
testRect6();
testRect7();
testRect8();
testRect9();*/

//draws first circle
if(mouseClicks == 0|| mouseClicks == 2|| mouseClicks == 4|| mouseClicks == 6|| mouseClicks == 8){
fill(0);
ellipse(mouseX, mouseY, a, a);// allows follows mouse
}
if(mouseClicks > 0){
fill(0);
ellipse(ellipseX1, ellipseY1, a, a);
}
//draws first square
if(mouseClicks == 1|| mouseClicks == 3|| mouseClicks == 5|| mouseClicks == 7|| mouseClicks == 9){
rect(mouseX, mouseY, b, b);
}
if(mouseClicks > 1){
fill(0);
rect(rectX1, rectY1, b, b);
}
//draws second circle
if(mouseClicks == 0|| mouseClicks == 2|| mouseClicks == 4|| mouseClicks == 6|| mouseClicks == 8){
ellipse(mouseX, mouseY, a, a);// allows follows mouse
}
if(mouseClicks > 2){
ellipse(ellipseX2, ellipseY2, a, a);
}
//draws second square
if(mouseClicks == 1|| mouseClicks == 3|| mouseClicks == 5|| mouseClicks == 7|| mouseClicks == 9){
rect(mouseX, mouseY, b, b);
}
if(mouseClicks > 3){
rect(rectX2, rectY2, b, b);
}
//draws third circle
if(mouseClicks == 0|| mouseClicks == 2|| mouseClicks == 4|| mouseClicks == 6|| mouseClicks == 8){
ellipse(mouseX, mouseY, a, a);// allows follows mouse
}
if(mouseClicks > 4){
ellipse(ellipseX3, ellipseY3, a, a);
}
//draws third square
if(mouseClicks == 1|| mouseClicks == 3|| mouseClicks == 5|| mouseClicks == 7|| mouseClicks == 9){
rect(mouseX, mouseY, b, b);
}
if(mouseClicks > 5){
rect(rectX3, rectY3, b, b);
}
//draws fourth circle
if(mouseClicks == 0|| mouseClicks == 2|| mouseClicks == 4|| mouseClicks == 6|| mouseClicks == 8){
ellipse(mouseX, mouseY, a, a);// allows follows mouse
}
if(mouseClicks > 6){
ellipse(ellipseX4, ellipseY4, a, a);
}
//draws fourth square
if(mouseClicks == 1|| mouseClicks == 3|| mouseClicks == 5|| mouseClicks == 7|| mouseClicks == 9){
rect(mouseX, mouseY, b, b);
}
if(mouseClicks > 7){
rect(rectX4, rectY4, b, b);
}
//draws fifth circle
if(mouseClicks == 0|| mouseClicks == 2|| mouseClicks == 4|| mouseClicks == 6|| mouseClicks == 8){
ellipse(mouseX, mouseY, a, a);// allows follows mouse
}
if(mouseClicks > 8){
ellipse(ellipseX5, ellipseY5, a, a);
}

if ((drawRect1 == 1 && drawRect2 == 1 && drawRect3 == 1) || (drawRect1 == 1 && drawRect4 == 1 && drawRect7 == 1)) // this is only testing two ways of winning but you would write out all of the possible ways of winning
{
player1win = true; //a global boolean variable to keep track of who wins
fill(0);
rect(0, 0, width, height);
}
}

void mousePressed(){
ellipse(mouseX, mouseY, 50, 50);
mouseClicks ++;
if(mouseClicks == 1){
ellipseX1 = mouseX;
ellipseY1 = mouseY;
}
if(mouseClicks == 2){
rectX1 = mouseX;
rectY1 = mouseY;
}
if(mouseClicks == 3){
ellipseX2 = mouseX;
ellipseY2 = mouseY;
}
if(mouseClicks == 4){
rectX2 = mouseX;
rectY2 = mouseY;
}
if(mouseClicks == 5){
ellipseX3 = mouseX;
ellipseY3 = mouseY;
}
if(mouseClicks == 6){
rectX3 = mouseX;
rectY3 = mouseY;
}
if(mouseClicks == 7){
ellipseX4 = mouseX;
ellipseY4 = mouseY;
}
if(mouseClicks == 8){
rectX4 = mouseX;
rectY4 = mouseY;
}
if(mouseClicks == 9){
ellipseX5 = mouseX;
ellipseY5 = mouseY;
}
/*drawRect1 = testRect1(mouseX, mouseY);
drawRect2 = testRect2(mouseX, mouseY);
drawRect3 = testRect3(mouseX, mouseY);
drawRect4 = testRect4(mouseX, mouseY);
drawRect5 = testRect5(mouseX, mouseY);
drawRect6 = testRect6(mouseX, mouseY);
drawRect7 = testRect7(mouseX, mouseY);
drawRect8 = testRect8(mouseX, mouseY);
drawRect9 = testRect9(mouseX, mouseY);*/
}

void drawCell1(){
stroke(0);
fill(211, 30, 194);
rect(0, 0, 200, 200);
}
void drawCell2(){
stroke(0);
fill(27);
rect(200, 0, 200, 200);
}
void drawCell3(){
stroke(0);
fill(255, 0, 0);
rect(200, 0, 200, 200);
}
void drawCell4(){
stroke(0);
fill(203, 41, 90);
rect(0, 200, 200, 200);
}
void drawCell5(){
stroke(0);
fill(61, 151, 178);
rect(200, 200, 200, 200);
}
void drawCell6(){
stroke(0);
fill(41, 185, 47);
rect(400, 200, 200, 200);
}
void drawCell7(){
stroke(0);
fill(224, 218, 32);
rect(0, 400, 200, 200);
}
void drawCell8(){
stroke(0);
fill(245, 137, 22);
rect(200, 400, 200, 200);
}
void drawCell9(){
stroke(0);
fill(255, 0, 0);
rect(400, 400, 200, 200);
}
/*int testRect0(int x, int y, int mouseClicks){ //test the top left rectangle, write 8 other functions to test the other areas
if(x > 0 && x 0 && y 0 && x 0 && y< height/3 && (mouseClicks == 1 || mouseClicks == 3 || mouseCLicks == 5 || mouseClicks == 7 || mouseClicks == 9)){
return 2; //there's an o in the area
}
else{
return 0; //nothing is in the area
}
}*/

Posted in Uncategorized | Leave a comment

Nafis Sabir Midterm Project

For my midterm project, I set out to create A visual seasonal calendar.
I wanted the user to be able type in the month of year and a scene pops up to depict the season or the complimenting season. Depending on the season the user would be able to play some type of interactive game that corresponded with the season. They would also be able press a key and switch to a scene of the opposite season. I planned to use a combination of images and graphics.
I was successful in making a 12 month calendar. The date shown is based on the date in the users computer. A new scene appear for every month. A numerical keypress to coincide with the month will play a sound for that season. There were a couple of challenges presented by the program. The first was not realizing I would actually have to try and create five separate programs to get the project to work the way I wanted. I need to learn about arrays to get the program the way I originally envisioned. I had some difficulty in getting the date to show in java and javascript. For some reason even with the change to the date code string the program will still only run in javascript. So I have to investigate further.
I also couldn’t figure out a good place to place a boolean or state function without the additional aspects I want to add to the program. In the future I want to add a minigame for the all of the seasons, the functionality to change between seasons, more scenes, and possibly background music.

I uploaded the project to openprocessing. But since the program won’t run in JS, I’m adding the code.

/*Nafis Sabir
Professor Calli Higgins
Midterm working draft*/

import ddf.minim.*;
//initialize audio
Minim minim;
AudioSample fireworks;
AudioSample hallow;
AudioSample leaves;
AudioSample love;
AudioSample snow2;
AudioSample ocean;
AudioSample olympic;
AudioSample rain;
AudioSample sleigh;
AudioSample birds;
AudioSample turkey;
AudioSample snow;

PImage january, february, march, april, may, june, july, august;
PImage september, october, november, december;
int d, m, y, dateX, dateY, spring, winter, fall, summer, season;
float l, r, u, dn;
PFont myfont;

void setup() {

size(640, 425);
l = width;
r = -600;
u = height;
dn = -425;
//loads audio
minim = new Minim(this);//start sound engine
//loads audio sample files
fireworks = minim.loadSample(“fireworks.wav”, 2048);
hallow = minim.loadSample(“hallow.mp3”, 256);
leaves = minim.loadSample(“leaves.mp3”, 256);
love = minim.loadSample(“love.mp3”, 256);
snow2 = minim.loadSample(“snow2.wav”, 256);
ocean = minim.loadSample(“ocean.mp3”, 256);
olympic = minim.loadSample(“olympic.mp3”, 256);
rain = minim.loadSample(“rain.mp3”, 256);
sleigh = minim.loadSample(“sleigh.mp3”, 256);
birds = minim.loadSample(“birds.mp3”, 256);
turkey = minim.loadSample(“turkey.mp3”, 256);
snow = minim.loadSample(“snow.mp3”, 256);
january = loadImage(“january.jpg”);
february = loadImage(“february.jpg”);
march = loadImage(“march.jpg”);
april = loadImage(“april.jpg”);
may = loadImage(“may.jpg”);
june = loadImage(“june.jpg”);
july = loadImage(“july.jpg”);
august = loadImage(“august.jpg”);
september = loadImage(“september.jpg”);
october = loadImage(“october.jpg”);
november = loadImage(“november.jpg”);
december = loadImage(“december.jpg”);

myfont = loadFont(“Dialog-70.vlw”);//temporary font for date
textFont(myfont, 70);
}

void draw() {
d = day(); // Values from 1 – 31
m = month(); // Values from 1 – 12
y = year(); // 2013, 2014, 2015, etc.
dateY = 60;//date y location
dateX = 20;//date x location
spring = #00CC00;//date fill for months spring
winter = #66A3D2;//date fill for months winter
fall = #FF6A00;//date fill for months fall
summer = #F7FE00;//date fill for months summer
winter();
spring();
summer();
fall();
for (int i = 0; i =1) {
l -= .4;
}
}
void imageRight() {//moves image from left to right
if (r = 1) {
u -= .4;
}
}

void imageDown() {//moves image from top to bottom
if (dn = 12) || (m= 3) && (m= 6) && (m= 9) && (m<= 11)) {
season = fall;
println("It's Fall!");//verify that season is fall
}
}
void keyPressed() {//sounds trigger according to what key is pressed
if (m==7 && key == '7' )fireworks.trigger();
if (m == 10 && key == '0' )hallow.trigger();
if (m == 9 && key == '9' )leaves.trigger();
if (m == 2 && key == '2' )love.trigger();
if (m == 3 && key == '3' )snow2.trigger();
if (m == 6 && key == '6' )ocean.trigger();
if (m == 8 && key == '8' )olympic.trigger();
if (m == 4 && key == '4' )rain.trigger();
if (m == 12 && key == 'd' )sleigh.trigger();
if (m == 5 && key == '5' )birds.trigger();
if (m == 11 && key == 'n' )turkey.trigger();
if (m == 1 && key == '1' )snow.trigger();
}

void stop() {//stops all audio sounds
fireworks.close();
hallow.close();
leaves.close();
love.close();
snow2.close();
ocean.close();
olympic.close();
rain.close();
sleigh.close();
birds.close();
turkey.close();
snow.close();
minim.stop();
super.stop();
}

Posted in Uncategorized | Leave a comment

Michael Haynes midterm1

Posted in Uncategorized | Leave a comment

Midterm project /Michael Haynes

float r = 0;
float x = 0;
float y = 0;
float c = 0;
float d = 0;
float e = 0;
float f = 0;
float g = 0;
//if r reaches y axis then Stop;
//if r reaches x axis then Stop;
//if r reaches z axis then Stop;

void setup(){
size(600,600, P3D);
fill(#A8D3F5);
smooth();
}
void draw(){
float x = width / 2 + cos(r) * 200;
float y = height /2 + sin (r) * 200;

r = r + 0.1;
if(r > TWO_PI) {
loop();
}

background(HSB);

ellipse(random(width), random(height),3, 3);

translate(mouseX, mouseY, map(noise(r), 0, 1, -400, 300));
fill(255);
box(50);
r = r + 0.01;
r = r + 0.01;

rotateX(x);
fill(#F24B31);
box(50);

x = x + 0.01;
x = x + 0.01;

rotateX(y);
fill(#F24B31);
box(50);

y = y + 0.01;
y = y + 0.01;

rotateZ(y);
fill(#4735F0);
box(50);
c = c + 0.01;
c = c + 0.01;

rotateY(r);
fill(#35E8F0);
box(50);

g = g + 0.01;

translate(mouseX, mouseY, map(noise(x), 0, 1, -400, 300));
rotateX(r);
fill(#EBF568);
box(50);

f = f + 0.02;

rotateX(r);
fill(#F29531);
box(50);

c = c + 0.02;

rotateY(r);
fill(#C93DD1);
box(50);

d = d + 0.02;

r = r;

box(50);
r = r + 0.01;
r = r + 0.01;

rotateX(x);
fill(#F24B31);
box(50);

}

Posted in Uncategorized | Leave a comment

Midterm Project

For my midterm project, I wanted to create a changing seasonal flower with the appropriate backgrounds to go along with it. Since there are 4 seasons, I would need 4 different stages of a flower. The flower starting from its “springing up from the ground” stage in spring, to its blooming stage in summer, to its “dying” stage in fall, and then to its “dead” stage in winter. I also wanted to add in little “extra’s” in my project such as for example, a little snowman off to the side in the winter season that would change colors if you clicked on the snowman. What I was actually able to create for my midterm project, was the uploading of the 4 seasonal backgrounds and a cover/title page. I wasn’t able to insert the 4 stages of a flower because I didn’t have Photoshop and I also couldn’t of added in the little extras either 🙁 When I did try to draw a flower into Processing itself, it was showing up in all of my backgrounds including my cover/title page. That caused a problem for me because I didn’t want a flower in the middle of my cover/title page. I would like to improve this project by actually finishing what I was set out to do originally. I can’t remember my openProcessing information for anything so here’s my code and a screen shot of my midterm project.

//Alyssa Seosankar – Prof. Higgins – Midterm Project

//Naming global variable(s) & images
int x = 0;
PImage myImage1;
PImage myImage2;
PImage myImage3;
PImage myImage4;
PImage myImage5;

void setup(){
//Setting window size
size(600, 600);
//Calling images
myImage1 = loadImage(“springBackground.jpg”);
myImage2 = loadImage(“summerBackground.jpg”);
myImage3 = loadImage(“fallBackground.jpg”);
myImage4 = loadImage(“winterBackground.jpg”);
myImage5 = loadImage(“fourSeasons.jpg”);
}

void draw(){
title();
changingBackgrounds();
}

//Making the title
void title(){
image(myImage5, x, x, 600, 600);
int m = millis();
textSize(70);
text(“The”, 150, 125);
text(“Four”, 300, 125);
text(“Seasons”, 170, 525);
fill(m % 255);
noFill();
}

//Changing the backgrounds
void changingBackgrounds(){
if(key == ‘1’){
image(myImage1, x, x, 600, 600);
}
else if(key == ‘2’){
image(myImage2, x, x, 600, 600);
}
else if(key == ‘3’){
image(myImage3, x, x, 600, 600);
}
else if(key ==’4′){
image(myImage4, x, x, 600, 600);
}
}

//void flower(){
// if(mousePressed == true){
// fill(191, 198, 4);
// } else {
// fill(243, 252, 3);
// }
// stroke(x);
// strokeWeight(3);
// ellipse(300, 200, 100, 100);
// noFill();
// noStroke();
// fill(x);
// strokeWeight(4);
// line(300, 0, 300, 600);
// noFill();
// noStroke();
//}

Posted in Uncategorized | Leave a comment

Midterm Blog Post

my original idea for the midterm project was to create three different mini games that will be activated once the user clicks on a certain button. i was only able to complete one game which was tic-tac-toe. there were many challenges i faced such as trying to set the circle and the square when the user clicked but i accomplished it. also when a user wins to stop the game and using states so that when the game finished it would restart. i was not able to accomplish that. i would like to improve this application by completing the goals that i was not able to accomplish.

PImage myImage;
int a = 100;
int b = 100;
int mouseClicks = 0;
int ellipseX1;
int ellipseY1;
int ellipseX2;
int ellipseY2;
int ellipseX3;
int ellipseY3;
int ellipseX4;
int ellipseY4;
int ellipseX5;
int ellipseY5;
int rectX1;
int rectY1;
int rectX2;
int rectY2;
int rectX3;
int rectY3;
int rectX4;
int rectY4;
int x = 0;
int y = 0;
/*boolean testRect1 = false;
boolean testRect2 = false;
boolean testRect3 = false;*/
boolean player1win = false;
boolean player2win = false;
int drawRect1;
int drawRect2;
int drawRect3;
int drawRect4;
int drawRect5;
int drawRect6;
int drawRect7;
int drawRect8;
int drawRect9;

void setup(){
size(600, 600);
background(77, 50, 191);
tint(0, 153, 204, 126);
myImage = loadImage(“processing.jpg”);
}
void draw(){
background(77, 50, 191);
smooth();
strokeWeight(3);
fill(0);
drawCell1();
drawCell2();
drawCell3();
drawCell4();
drawCell5();
drawCell6();
drawCell7();
drawCell8();
drawCell9();

image(myImage, 401, 401, 198, 198);

/*testRect1();
testRect2();
testRect3();
testRect4();
testRect5();
testRect6();
testRect7();
testRect8();
testRect9();*/

//draws first circle
if(mouseClicks == 0|| mouseClicks == 2|| mouseClicks == 4|| mouseClicks == 6|| mouseClicks == 8){
fill(0);
ellipse(mouseX, mouseY, a, a);// allows follows mouse
}
if(mouseClicks > 0){
fill(0);
ellipse(ellipseX1, ellipseY1, a, a);
}
//draws first square
if(mouseClicks == 1|| mouseClicks == 3|| mouseClicks == 5|| mouseClicks == 7|| mouseClicks == 9){
rect(mouseX, mouseY, b, b);
}
if(mouseClicks > 1){
fill(0);
rect(rectX1, rectY1, b, b);
}
//draws second circle
if(mouseClicks == 0|| mouseClicks == 2|| mouseClicks == 4|| mouseClicks == 6|| mouseClicks == 8){
ellipse(mouseX, mouseY, a, a);// allows follows mouse
}
if(mouseClicks > 2){
ellipse(ellipseX2, ellipseY2, a, a);
}
//draws second square
if(mouseClicks == 1|| mouseClicks == 3|| mouseClicks == 5|| mouseClicks == 7|| mouseClicks == 9){
rect(mouseX, mouseY, b, b);
}
if(mouseClicks > 3){
rect(rectX2, rectY2, b, b);
}
//draws third circle
if(mouseClicks == 0|| mouseClicks == 2|| mouseClicks == 4|| mouseClicks == 6|| mouseClicks == 8){
ellipse(mouseX, mouseY, a, a);// allows follows mouse
}
if(mouseClicks > 4){
ellipse(ellipseX3, ellipseY3, a, a);
}
//draws third square
if(mouseClicks == 1|| mouseClicks == 3|| mouseClicks == 5|| mouseClicks == 7|| mouseClicks == 9){
rect(mouseX, mouseY, b, b);
}
if(mouseClicks > 5){
rect(rectX3, rectY3, b, b);
}
//draws fourth circle
if(mouseClicks == 0|| mouseClicks == 2|| mouseClicks == 4|| mouseClicks == 6|| mouseClicks == 8){
ellipse(mouseX, mouseY, a, a);// allows follows mouse
}
if(mouseClicks > 6){
ellipse(ellipseX4, ellipseY4, a, a);
}
//draws fourth square
if(mouseClicks == 1|| mouseClicks == 3|| mouseClicks == 5|| mouseClicks == 7|| mouseClicks == 9){
rect(mouseX, mouseY, b, b);
}
if(mouseClicks > 7){
rect(rectX4, rectY4, b, b);
}
//draws fifth circle
if(mouseClicks == 0|| mouseClicks == 2|| mouseClicks == 4|| mouseClicks == 6|| mouseClicks == 8){
ellipse(mouseX, mouseY, a, a);// allows follows mouse
}
if(mouseClicks > 8){
ellipse(ellipseX5, ellipseY5, a, a);
}

if ((drawRect1 == 1 && drawRect2 == 1 && drawRect3 == 1) || (drawRect1 == 1 && drawRect4 == 1 && drawRect7 == 1)) // this is only testing two ways of winning but you would write out all of the possible ways of winning
{
player1win = true; //a global boolean variable to keep track of who wins
fill(0);
rect(0, 0, width, height);
}
}

void mousePressed(){
ellipse(mouseX, mouseY, 50, 50);
mouseClicks ++;
if(mouseClicks == 1){
ellipseX1 = mouseX;
ellipseY1 = mouseY;
}
if(mouseClicks == 2){
rectX1 = mouseX;
rectY1 = mouseY;
}
if(mouseClicks == 3){
ellipseX2 = mouseX;
ellipseY2 = mouseY;
}
if(mouseClicks == 4){
rectX2 = mouseX;
rectY2 = mouseY;
}
if(mouseClicks == 5){
ellipseX3 = mouseX;
ellipseY3 = mouseY;
}
if(mouseClicks == 6){
rectX3 = mouseX;
rectY3 = mouseY;
}
if(mouseClicks == 7){
ellipseX4 = mouseX;
ellipseY4 = mouseY;
}
if(mouseClicks == 8){
rectX4 = mouseX;
rectY4 = mouseY;
}
if(mouseClicks == 9){
ellipseX5 = mouseX;
ellipseY5 = mouseY;
}
/*drawRect1 = testRect1(mouseX, mouseY);
drawRect2 = testRect2(mouseX, mouseY);
drawRect3 = testRect3(mouseX, mouseY);
drawRect4 = testRect4(mouseX, mouseY);
drawRect5 = testRect5(mouseX, mouseY);
drawRect6 = testRect6(mouseX, mouseY);
drawRect7 = testRect7(mouseX, mouseY);
drawRect8 = testRect8(mouseX, mouseY);
drawRect9 = testRect9(mouseX, mouseY);*/
}

void drawCell1(){
stroke(0);
fill(211, 30, 194);
rect(0, 0, 200, 200);
}
void drawCell2(){
stroke(0);
fill(27);
rect(200, 0, 200, 200);
}
void drawCell3(){
stroke(0);
fill(255, 0, 0);
rect(200, 0, 200, 200);
}
void drawCell4(){
stroke(0);
fill(203, 41, 90);
rect(0, 200, 200, 200);
}
void drawCell5(){
stroke(0);
fill(61, 151, 178);
rect(200, 200, 200, 200);
}
void drawCell6(){
stroke(0);
fill(41, 185, 47);
rect(400, 200, 200, 200);
}
void drawCell7(){
stroke(0);
fill(224, 218, 32);
rect(0, 400, 200, 200);
}
void drawCell8(){
stroke(0);
fill(245, 137, 22);
rect(200, 400, 200, 200);
}
void drawCell9(){
stroke(0);
fill(255, 0, 0);
rect(400, 400, 200, 200);
}
/*int testRect0(int x, int y, int mouseClicks){ //test the top left rectangle, write 8 other functions to test the other areas
if(x > 0 && x < width/3 && y > 0 && y < height/3 && (mouseClicks == 0 || mouseClicks == 2 || mouseCLicks == 4 || mouseClicks == 6 || mouseClicks == 8)){
return 1; //there’s a x in the area
}
else if(x > 0 && x < width/3 && y > 0 && y< height/3 && (mouseClicks == 1 || mouseClicks == 3 || mouseCLicks == 5 || mouseClicks == 7 || mouseClicks == 9)){
return 2; //there’s an o in the area
}
else{
return 0; //nothing is in the area
}
}*/

Posted in Uncategorized | Leave a comment

MY MIDTERM Report

my soccer gamehttp://www.openprocessing.org/sketch/94218

For my midterm i decided to create a soccer game with a goalie. My initial idea was to have two teams of players with red and blue ellipse. Due to the short time and also to make my game more real,  i thought uploading an image of a goalie would be better. Difficulties encountered during this project was writing out the boolean functions. However, my midterm would have been much more interactive and fun if i was able to upload sounds and game scores.

Posted in Uncategorized | 1 Comment

Midterm by Reno Abraham

http://www.openprocessing.org/sketch/94075

The idea of my  midterm project was to make the robot move and if i can make it move by clicking on his chest  then i would try to make the robot do the wave with his arms but as you can see when you run the program the robot chest move and so does his fingers. The challenges i had was to visualize how the robot would look like and how to move the robot whole body. Then i started to have problems with the arms at the last second  but i just comment it out. For some reason when i run the code on open processing the sketch is showing a blink brown pic so i would put the code on blog post.For the future i would try to make the robot have  some sound and maybe have my name printed on his chest ever time you click on his antenna, if it is possible then i would try to  make the robot do actually robot(the dance).

int hY=105;
int hX=278;
int hW=45;
int hL=45;
int hsX=323;
int hsY=150;
int hsX2=329;
int hsY2=94;
int hsX3=326;
int htX=279;
int htY=104;
int htX2=286;
int htY2=94;
int htX3=329;
int htX4=324;
// rbot neck
int nX=295;
int nY=150;
int nL=20;
int nW=10;
//robot body
int bX=258;
int bY=165;
int bW=85;
int bL=80;
int blX=258;
int blY=244;
int blX2=251;
int blY2=245;
int blY3=155;
int blX3=248;
int brX=344;
int brY=245;
int brX2=350;
int brY2=238;
int brX3=349;
int brY3=155;
int blsX=258;
int blsY=166;
int blsX2=253;
int blsY2=154;
int blsX3=296;
int blsY3=185;
int brsX=304;
int brsY=166;
int brsX2=304;
int brsY2=154;
int brsX3=346;
int brsX4=343;
int brsY3=165;
//robot right shoulder using arc
float rsX=345;
float rsY=180;
float rsW=30;
float rsH=30;
float rsStart=0;
float rsStop=6.283185307;
float rsMode=OPEN;
//robot left shoulder
float lsX=255;
float lsY=180;
float lsW=30;
float lsH=30;
//int

//robot right arms
int raX=357;
int raY=179;
int raX2=360;
int raY2=180;
int raX3=368;
int raY3=182;
int raX4=376;
int raY4=184;
int raX5=379;
int raY5=198;
int raX6=379;
int raY6=219;
int raX7=361;
int raY7=198;
int raW=30;
int raL=40;
//robot left arm
int laX=258;
int laY=198;
int laW=30;
int laL=40;
int laX2=258;
int laX3=232;
int laX4=225;
int laX5=220;
int laX6=205;
// robot right leg
int rX=269;
int rY=264;
int rX2=15;
int rY2=70;

//robot left leg
int lX=313;
int lY=264;
// robot left feet
int flX=268;
int flY=333;
int flY2=344;
int flX2=284;
int flX3=257;
//robot right feet
int frX=313;
int frX2=328;
int frX3=339;
// robot mouth
int mL=10;
int mW=40;
int mX=280;
int mY=135;
// robot eyes
int reL=10;
int reW=10;
int reX=313;
int reY=120;
int leX=287;
// robot anteena
int anteenaX=306;
int anteenaY=103;
int anteenaX2=306;
int anteenaY2=71;
//robot hip
float hipX=275;
float hipY=246;
float hipX2=326;
float hipY2=246;
float hipX3=344;
float hipY3=265;
float hipX4=256;
float hipY4=265;
int hipX5=277;
int hipY5=265;
int hipW=30;
int hipL=30;
int hipX6=320;
int hipY6=265;
//robot finger
int fingerX=207;
int fingerY=238;
int fingerX2=207;
int fingerY2=252;
int fingerX3=201;
int fingerW=10;
int fingerL=10;
// second finger
int sfingerX=222;
int sfingerX2=222;
int sfingerX3=216;
//third finger
int tfingerX=235;
int tfingerX2=235;
int tfingerX3=231;
//fouth finger
int fFingerX=362;
int fFingerX2=362;
int fFingerX3=362;
// fifth finger
int fiFingerX=376;
int fiFingerX2=376;
int fiFingerX3=376;
// six finger
int sifingerX=391;
int sifingerX2=391;
int sifingerX3=391;
int i=0;
float r,g,b;
boolean robotmove=false;
int speed=1;
PImage img;
void setup() {
size(708, 700);
smooth();

img= loadImage(“DanceFloor.jpg”);
}
void draw() {
image(img, 0, 150);
background(50);
robot(430,500,bX,bX);
move();
int x=height/2;
int y=width/2;
int w=0;
int l=0;

ellipse(reX,reY,reW,reL);
ellipse(leX,reY,reW,reL);
if(bX<width/2||x>width){
speed=speed*-1;
bX=bX+speed;
}
if(robotmove){
bX=bX;

}
else{
bX=bX+speed;}
if(bX<0|| bX>width){
speed=speed*-1;
}
//}

 

 

 

 

 

void move() {
bX=bX+1;

fingerY2=fingerY2+speed;

if(fingerX<height){
fingerY2=speed*-1;
} }

void robot(int x, int y, int size, int fill) {

//ellipse(x,y,size,fill);
//size(x,y);
fill(255);
line(fingerX, fingerY, fingerX2, fingerY2);
rect(fingerX3, fingerY2, fingerW, fingerL);
line(sfingerX, fingerY, sfingerX2, fingerY2);
rect(sfingerX3, fingerY2, fingerW, fingerL);
line(tfingerX, fingerY, tfingerX2, fingerY2);
rect(tfingerX3, fingerY2, fingerW, fingerL);
line(fFingerX, fingerY, fFingerX2, fingerY2);
ellipse(fFingerX, fingerY2, fingerW, fingerL);
line(fiFingerX, fingerY, fiFingerX, fingerY2);
ellipse(fiFingerX, fingerY2, fingerW, fingerL);
line(sifingerX, fingerY, sifingerX, fingerY2);
ellipse(sifingerX, fingerY2, fingerW, fingerL);
beginShape();
vertex(blX, blY);
vertex(blX2, blY2);
vertex(blX2, blY3);
vertex(blX, blY3);
endShape();
beginShape();
vertex(hsX, hsY);
vertex(hsX2, hsY);
vertex(hsX2, hsY2);
vertex(hsX3, hsY2);
endShape();
//noFill();
beginShape();
vertex(brX, brY);
vertex(brX2, brY2);
vertex(brX3, brY3);
vertex(brX, brY3);
endShape();
beginShape();
vertex(blsX, blsY);
vertex(blsX2, blsY2);
vertex(blsX3, blsY2);
vertex(blsX3, brsY3);
endShape();
beginShape();
vertex(brsX, brsY);
vertex(brsX2, brsY2);
vertex(brsX3, brsY2);
vertex(brsX4, brsY3);
endShape();
rect(hX, hY, hW, hL);
rect(nX, nY, nW, nL);
rect(laX6, raY7, laW, laL);
rect(raX7, raY7, raW, raL);
// fill(255);
beginShape();
noFill();
curveVertex(raX, raY);
curveVertex(raX2, raY2);
curveVertex(raX3, raY3);
curveVertex(raX4, raY4);
curveVertex(raX5, raY5);
curveVertex(raX6, raY6);
endShape();
beginShape();
curveVertex(laX, raY);
curveVertex(laX2, raY2);
curveVertex(laX3, raY3);
curveVertex(laX4, raY4);
curveVertex(laX5, raY5);
curveVertex(laX6, raY6);
endShape();
fill(255);
//arc(lsX, lsY, lsW, lsH, rsStart, rsStop, rsMode);
//arc(rsX, rsY, rsW, rsH, rsStart, rsStop, rsMode);
rect(bX, bY, bW, bL);
rect(rX, rY, rX2, rY2);
rect(lX, lY, rX2, rY2);
//arc(hipX5, hipY5, hipW, hipL, 0, PI, OPEN);
//arc(hipX6, hipY6, hipW, hipL, 0, PI, OPEN);
ellipse(reX, reY, reW, reL);
ellipse(leX, reY, reW, reL);
rect(mX, mY, mW, mL);
line(anteenaX, anteenaY, anteenaX2, anteenaY2);
//ellipse(anteenaX2, anteenaY2, 20, 20);
quad(hipX, hipY, hipX2, hipY2, hipX3, hipY3, hipX4, hipY4);
beginShape();
vertex(flX, flY);
vertex(flX2, flY);
vertex(flX2, flY2);
vertex(flX3, flY2);
vertex(flX, flY);
endShape();
beginShape();
vertex(frX, flY);
vertex(frX2, flY);
vertex(frX3, flY2);
vertex(frX, flY2);
vertex(frX, flY);
endShape();
beginShape();
vertex(htX, htY);
vertex(htX2, htY2);
vertex(htX3, htY2);
vertex(htX4, htY);
endShape();
stroke(0);
// randomSeed(10);
fill(r,g,b);
ellipse(anteenaX2, anteenaY2, 20, 20);
//line(0, height/2, width, height/2);
//line(width/2, 0, width/2, height);
println(mouseX);
println(mouseY);
r=random (255);
b=random(0);
g=random(0);
}
void mousePressed(){
if(mouseX>bX&&mouseX<bX+bW&& mouseY>bY&&mouseY<bY+bL){
robotmove=!robotmove;
}}

Posted in Uncategorized | Leave a comment