Reader small image

You're reading from  The Essential Guide to Creating Multiplayer Games with Godot 4.0

Product typeBook
Published inDec 2023
Reading LevelIntermediate
PublisherPackt
ISBN-139781803232614
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Henrique Campos
Henrique Campos
author image
Henrique Campos

Henrique Campos is an indie game developer and game designer working in the industry since 2015. Starting as a University teacher in the Computer Graphics and Artificial Intelligence chairs and working for the GDQuest team from 2018 to 2022, he has also been providing consultancy for solo developers, studios, and schools. Under the alias of Pigdev, Henrique has been creating game development content on his YouTube channel since 2016. Among his projects, he wrote the Top 7 Godot Engine Recipes and the Platformer Essential Recipes ebooks where he presents design patterns that people can use to make games with the Godot Engine. A passionate open-source enthusiast, Henrique has been working and contributing to the Godot Engine project since 2016.
Read more about Henrique Campos

Right arrow

Adding the player’s avatar

In any online game, the player’s avatar is a crucial element that represents them in the virtual world. In the previous section, we successfully authenticated the player and saved their session token and username in our AuthenticationCredentials autoload. Now, it’s time to use that information to display the player’s avatar in the lobby.

To achieve this, we will retrieve the player’s avatar information from our fake database and create a new AvatarCard, a custom scene with a TextureRect node to display the avatar’s image and a label to show its name. This way, players will be able to easily identify each other and feel more connected to the game world.

For that, let’s open the LobbyClient.gd script. Here, we are going to do three major things:

  1. Retrieve the avatar information from the server by making an RPC to the retrieve_avatar() method.
  2. Implement the add_avatar() method that LobbyServer...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
The Essential Guide to Creating Multiplayer Games with Godot 4.0
Published in: Dec 2023Publisher: PacktISBN-13: 9781803232614

Author (1)

author image
Henrique Campos

Henrique Campos is an indie game developer and game designer working in the industry since 2015. Starting as a University teacher in the Computer Graphics and Artificial Intelligence chairs and working for the GDQuest team from 2018 to 2022, he has also been providing consultancy for solo developers, studios, and schools. Under the alias of Pigdev, Henrique has been creating game development content on his YouTube channel since 2016. Among his projects, he wrote the Top 7 Godot Engine Recipes and the Platformer Essential Recipes ebooks where he presents design patterns that people can use to make games with the Godot Engine. A passionate open-source enthusiast, Henrique has been working and contributing to the Godot Engine project since 2016.
Read more about Henrique Campos