Wow this island is lit! But lets keep the fire going, but paarrty!
Hmmm. I wanna hunt some pigs and party!
OMG A SHIP!!! IS THE FIRE GOING??!!
WHY WASN'T THE FIRE GOING?!!? NO MORE PARTIES!
Hey hey hey I caught this pig lets calm down about getting rescued
As you can see in the image above, Ralph feels the need to mess around and not take the situation seriously because there aren't any adults.
Ralph sees a ship and this is what changes him. Being this close to rescue changes his perspective to the island.
Ralph gets mad at Jack becuase he went hunting, which is not the main priority, and they let the fire go out when the boat could've seen them. This shows that Ralph isn't in the mood to party, and wants to focus on getting rescued.