This line
calls the other constructor, so this line:
So 'p' is now the new UserWalk1 object and can be used to assign it to the player variable with
When changing the world,
the player is passed to the next world, so 'p' and then also 'player' in the next world is the same UserWalk1 object.
(Now, after thinking about it, you could probably just make it static and even final and forget about all this "pass to new world" thing...)
The x and y variable are used as the location where the player (=UserWalk1) should be added. The x variable is depending on the last world (right or left edge). (If any world should effect this, too, you add it to its switch case.
For EloraWalk1, you would also create an x and y variable (maybe xElora and yElora), set it depending on the last world and then, add it to the world:
this(new UserWalk1(), 0, -1);
public MyWorld(Actor p, int worldType, int lastWorldType)
player = p;
Greenfoot.setWorld(new MyWorld(player, type+change, type));
addObject(player.getEloraWalk(), xElora, yElora);