M
Motivating
Guest
Fixed
Last edited by a moderator:
y1=0;
y2=-sprite_height;
y1+=5;//replace with speed
y2+=5;
if(y1>sprite_height){
y1-=sprite_height;
}
if(y2>sprite_height){
y2-=sprite_height;
}
draw_sprite(sprite_index,0,room_width/2,y1);
draw_sprite(sprite_index,0,room_width/2,y2);
side=choose(-1,1);//left or right
x=room_width/2+side*(tree_width/2);//replace tree_width with actual width of tree
vspeed=5;//replace with speed you want it to go down (same as tree), probably just use a global variable like global.down_speed
if(side==1){
sprite_index=spr_branch_right;
}else{
sprite_index=spr_branch_left;
}
if speed < maxSpeed {
//increase branches and background speed
}
global.b_passed=0;
global.down_speed=5;
global.b_passed+=1;
if(global.b_passed mod 10==0){//remainder after division by 10 == 0
global.down_speed*=1.05;//increase speed by 5%
with(obj_branch){
vspeed=global.down_speed;//all current branches speed up
}
}
global.b_passed+=1;
if(global.b_passed mod 5==0){//remainder after division by 5 == 0
global.down_speed*=1.05;//increase speed by 5%
with(Left_Branch){
vspeed=global.down_speed;//all current branches speed up
}
}
vspeed=global.down_speed;
instance_destroy()
if(y>room_height){
instance_destroy();
}
if y>room_height{
instance_destroy();
}
vspeed=global.down_speed;