hello, im very new to coding. my college beginner's course uses Java script in Processing 3. for my project, i need to make my avatar scale to a different size every time he goes across the screen. the scaling using a while loop is what im having a problem with. we have to put the avatar in a function call. ill post what code i have below. i need help ASAP! thanks!
int Mart_start_x = -100;
int Mart_start_y = 570;
int Mart_speed = 4;
int r_Leg_x = 50;
int r_Leg_speed = 1;
int l_Leg_x = -50;
int l_Leg_speed = -1;
int Mart_count = 0;
float scale_size = .5;
void setup()
{
size(1500,750);
}
void draw()
{
background (255);
fill(150);
MartFunction(Mart_start_x, 570, 1);
{
scale_size = scale_size + .5;
}
scale_size = 0;
Mart_start_x= Mart_start_x + Mart_speed;
if(Mart_start_x > width+100)
{
Mart_start_x = -100;
}
r_Leg_x = r_Leg_x + r_Leg_speed;
if((r_Leg_x > 65) || (r_Leg_x < 35))
{
r_Leg_speed = r_Leg_speed * -1;
}
l_Leg_x = l_Leg_x + l_Leg_speed;
if((l_Leg_x > -35) || (l_Leg_x < -65))
{
l_Leg_speed = l_Leg_speed * -1;
}
}
void MartFunction(int x_loc, int y_loc, float scale_size)
{
pushMatrix();
translate(x_loc,y_loc);
scale(scale_size);
stroke(5);
line(0,-50,r_Leg_x,125);
stroke(5);
line(0,-50,l_Leg_x,125);
noStroke();
fill(#084B0F);
ellipse(0,0,75,175);
noStroke();
fill(#2C8E11);
ellipse(0,-100,200,100);
noStroke();
fill(#EBFF17);
ellipse(-50,-100,25,50);
noStroke();
fill(#EBFF17);
ellipse(0,-100,25,65);
noStroke();
fill(#EBFF17);
ellipse(50,-100,25,50);
popMatrix();
}
What I have tried:
my professor hasn't emailed back since my first email sent over a week ago asking for help. no one else knows what to do