Guide by Pvic
Import sprite spr_sonic_bubble: https://cdn.discordapp.com/attachments/403203277568606219/408329128018706432/spr_sonic_bubble_strip5.png
Make it's offset 32 x and 37 y
Make obj_bubble_switch give it the sprite spr_switch Create
image_speed=0;
alarm 0
image_index=0;
Step:
if distance_to_object(obj_hover_bubble)>64 && image_index==1{
instance_create(x,y-20,obj_hover_bubble)
}
Collision with par_player
if other.ai_flag==false{image_index=1
alarm[0]=30;}
` make object obj_hover_bubble make it parent obj_control create
activated=false
Destroy
global.main_player.visible=true;
Step
if activated==true{
//Animation inside bubble
if global.main_player.animation!="spring_fall"{
global.main_player.animation="spring_fall"}
//If the player is hurt or dead destroy
if global.main_player.action==ConActHurt ||global.main_player.action==ConActDead{
instance_destroy()
}else{
global.main_player.shield=4
}
//Make the player invisible
global.main_player.visible=false
//Change sprite
if global.main_player.character==ConCharSonic{
sprite_index=spr_sonic_bubble
}
//Make the player in the same position as the bubble
global.main_player.x=x;
global.main_player.y=y;
//Make the player not move
global.main_player.speed_x=0;
global.main_player.speed_y=0;
//Destroy over water
if global.main_player.underwater==false{
instance_destroy()
}
//If the player jumps, destroy bubble
if global.main_player.key_action_pressed{
instance_destroy();
}
//Move Left
if global.main_player.key_left_pressed{
hspeed=-2
}
if global.main_player.key_left_released{
hspeed=0
}
//Move Right
if global.main_player.key_right_pressed{
hspeed=2
}
if global.main_player.key_right_released{
hspeed=0
}
//Move Down
if global.main_player.key_down_pressed{
vspeed=2
}
if global.main_player.key_down_released{
vspeed=0
}
//Move Up
if global.main_player.key_up_pressed{
vspeed=-2
}
if global.main_player.key_up_released{
vspeed=0
}
}
Collision with par_player
if other.ai_flag==false && activated==false{
activated=true
other.action=ConActSpring
}
Collision with par_hurt, par_enemy and par_terrain:
instance_destroy()
.