Hi guys,

I’m working on a processing game called Frogger. I created the world and the frog, but I could not move the frog. I am pretty sure there are some problems in my codes, but I just could not find the problems, could anyone check my codes, and tell me which part is wrong? Thank you sooooo much.

int level=1;

int bandHeight;

int bandWidth;

float x;

float y;

boolean up,down,left,right;

void setup()

{

fullScreen();

bandHeight=height/5;

bandWidth=width;

}

void draw()

{

drawWorld();

drawFrog(width/2,height/5*4.5,bandHeight/1.5);

}

void drawWorld()

{

fill(0);

rect(0,0,bandWidth,bandHeight);

for (int i=0;i<level+2;i++)

{

fill(0,0,100);

noStroke();

rect(0,bandHeight*(level+i),bandWidth,bandHeight);

}

fill(0);

rect(0,bandHeight*(level+3),bandWidth,bandHeight);

}

void drawFrog(float x, float y, float diam)

{

fill(0,100,0);

ellipse(x/1.08,y*1.03,diam/2.5,diam/1.5);
ellipse(x*1.08,y

*1.03,diam/2.5,diam/1.5);*

stroke(0);

ellipse(x,y,diam,diam);

fill(255);

ellipse(x/1.05,y/1.06,diam/3,diam/3);

ellipse(x1.05,y/1.06,diam/3,diam/3);

stroke(0);

ellipse(x,y,diam,diam);

fill(255);

ellipse(x/1.05,y/1.06,diam/3,diam/3);

ellipse(x

fill(0);

ellipse(x/1.05,y/1.07,diam/5,diam/5);

ellipse(x*1.05,y/1.07,diam/5,diam/5);

}

void moveFrog(float xChange, float yChange)

{

y=y+yChange*bandHeight;
x=x+xChange*bandHeight;

}

void keyPressed()

{

setkeys(keyCode,true);

println(keyCode);

}

void keyReleased()

{

setkeys(keyCode,false);

}

final void setkeys(int k, boolean decision)

{

if(k == ‘I’ | k == ‘W’)

{

moveFrog(0,-1);

up = decision;

}

else if (k == ‘S’| k ==‘K’)

{

moveFrog(0,1);

down = decision;

}

else if (k == ‘D’ | k == ‘L’)

{

moveFrog(1,0);

right = decision;

}

else if (k == ‘A’ | k==‘J’)

{

moveFrog(-1,0);

left = decision;

}

}