HarmonyOS

Cocos Creator games can use HarmonyOS multi-screen collaboration for a new multiplayer experience

Published

on

Back in June, Huawei officially launched HarmonyOS 2 for mobile devices, and it comes with various new features powered by the new distributed capabilities. This helps users to enjoy a seamless cross-device experience more conveniently.

However, game-making software also acknowledging the power of HarmonyOS. As Cocos Creator, a well-known gaming creation platform became the first of its kind software to adopt the HarmonyOS 2 operating system.

Cocos Creator 3.2 version brings HarmonyOS 2 support and can fully utilize the new distributed capabilities of this operating system. Developers can easily develop games with multi-device collaboration features.

To create a new project in Cocos Creator, select the new project with HarmonyOS operating system, then import the completed project into the DevEco Studio to compile/package/deploy, and debug.

The overall workflow is similar to that of developers publishing to other native mobile platforms, and it is very simple for developers familiar with this type of development.

The Cocos Creator engine brings a multi-device collaboration game template that supports HarmonyOS, allowing developers to quickly create games that support multi-device collaboration through this template.

Developers can apply after discovery, pairing, connection, combination, and verification, two devices can be connected to create more interesting applications and increase the entire gameplay experience.

Grab the Gold Coins Game:

Such power of HarmonyOS will empower a game such as “Grab the Gold Coins”, which emphasizes the HarmonyOS multi-collab game template on the Cocos engine.

The game can quickly realize the device discovery and connection functions on HarmonyOS, using the mobile phone as a gamepad to control the large screen, and gameplay is easy to understand and play.

To play such games, A bigger screen (a Huawei Smart TV) will work as the display and the smartphone as a controller.

When the game starts, the smart screen will pop up the device selection page, select a nearby Huawei phone as the handle input terminal, establish a connection, and initialize the device.

After the connection is established, the smart screen will use the senDataToRemote interface to inform that the mobile phone can enter the game state as a controller, and the mobile phone as a handle receives the signal that the game can start operation through onRemoteRequest, and starts to send the control data to the smart screen.

Overall, the game process In, all control data can be transmitted and fed back through these two interfaces to realize the game logic of picking up gold coins, picking up hammers, and grabbing gold coins.

Using multiple devices:

The distributed capability of HarmonyOS 2 allows mobile devices to quickly virtualize to handle the smart TV connections and transforms into an interactive console. This enables users to connect with multiple devices into one game and get a multi-player user experience.

Copyright © 2022 Huaweicentral.com