Day 5 code.MidtermGame: Dance Oracle 手神

 

— processing code —

//variables

PImage image;
float x;
float y;
int w;
int h;

void setup(){
x = 500;
y = 300;
size(1300,800);
w = width/2;
h = height/2;
image = loadImage(“game-01.jpg”);
}

void draw() {
image(image, 0, 0, 1300,800);

if(keyPressed){
if(key == CODED){

if(keyCode == UP){
fill(1,168, 158, 160);
noStroke();
rect(w/8, y/0.6, x, y);
}
} if(keyCode == LEFT){
fill(1,168, 158, 160);
noStroke();
rect(w/8, y/1.5, x, y);

} if(keyCode == RIGHT){
fill(1,168, 158, 160);
rect(w/1.01, y/1.5, x, y);

} if(keyCode == DOWN){
fill(1,168, 158,160);
rect(w/1.01, y/0.6, x, y);

} if(keyCode == CONTROL){
fill(1,168, 158,160);
rect(w/1.01, y/0.6, x, y);

} if(keyCode == CONTROL){
fill(1,168, 158,160);
rect(w/5.5, y/0.6, x, y);

} if(keyCode == SHIFT){
fill(1,168, 158,160);
rect(w/5.5, y/1.5, x*2, y*2);
}
}
}

 

—end processing code —

for separate file on determining stages: GitHub Game Stages Code

Leave a Reply

Your email address will not be published. Required fields are marked *