# Get started quickly

This article will use the capabilities provided by the mini game to make a simple square rotation mini game, aiming to introduce the development process of the mini game from scratch.

# Register a mini game account

Enter the Mini Program Registration Page Fill in the information and submit the corresponding information according to the guidelines, the service category should select "Game", subcategory You can choose "Casual Game" first, and you can have your own mini game account.

# Install and start developer tools

After registering a mini game account, you should download Developer Tools and install it on your computer.

Open the installed developer tools client, use the WeChat account that you just registered for the mini game account to "scan" and scan the code to enter the mini game development environment.

Select "Mini Game Tab" in the "Mini Program Project" on the left, and then click the "+" sign on the right to start creating a Mini Game project.

Fill in the appropriate project name, select the appropriate empty directory of the machine, login Just registered the applet management platform, find the AppID of the applet as shown in the figure below, and fill it in The "AppId" text box of the form.

After completing the filling, click the "New" button in the lower right corner to complete the creation of the mini game.

You can enter the visual development interface of the mini game in the developer tools.

# Start developing the game

Next, we will use the capabilities provided by the mini game framework to complete the basic function of drawing cube rotation.

# Create a cube

Developers can right-click the entity node Main Camera in the Hierarchy tab on the left to create a cube. Then click to select the Cube node and set the z of its position property in the Inspector tab to 5, so that we can see it in the perspective of the game camera.

# Create script component

The mini game framework recommends using TypeScript to write mini game logic. You can right-click on the Project tab to create a script component and name it rotate.

Then you can drag the created script from the Project tab to Hierachy's Cube_1 node. In this way, we have added the script component to the cube node. You can find that there is a rotate component in the Inspector of the Cube node. .

# Save the scene

The "Save" button in the upper left corner, or use the shortcut key Ctrl+S (command+S on MacOs), you can save the game space you just created as a scene resource. Take the name of a cube, and the resource will be placed on assets/cube.scene.

# Let the cube rotate

The tool has a built-in code editor. Developers can right-click the rotate.ts script file just created in the Project and use the built-in editor to open it. Then write the rotating code in onUpdate in the code. The onUpdate life cycle will be refreshed at the frequency of requestAnimationFrame and manipulated to the entity where the cube is located through this.entity. Remember to save the code after modification.

public onUpdate(dt) {
  this.entity.transform.rotate(engine.Vector3.createFromNumber(15*dt, 30* dt, 45 * dt), true, false)
}

# Quickly view the running effect

At this time, we select the 3D scene we just created in the 2d/3d demo button at the top and middle: cube.scene. Then click play again to make the game run.

When playing, the developer can see the rotating square in the Game tab, and our game logic is running. At the same time, you can view the real-time game status in the hierarchy and inspector tabs. After pressing stop, you can return to the editing mode.

# Building the game

After returning to the editing mode, next we have to build the game and compress and package the resources needed by the game. Click Build >> Build Project in the upper left corner to open the Build panel. Click "Select Task", select "WeChat Mini Game", then click "Start Construction", and select the cube.scene scene in the 3D portal scene. After construction, all products will be placed in the minigame directory. The product can also be debugged using the simulator preview.

# Preview on mobile

Click the "Preview" button in the developer tools, scan the QR code with your mobile phone, and you can preview the effect of the mini game you just created on your mobile phone.

# Upload to the demo version

When the mini game is developed to a certain stage and you want to experience it for other partners of the project team, you can submit an experience version. The specific operation method is to first click "Upload" in the upper right corner of the Build tab.

After filling in the version number and project remarks in the pop-up window, click the "Upload" button.

After the upload is successful, you need to login applet management platform, click "version management". On the right page, select the version you just submitted, and click "Select as the trial version".

After selecting the trial version, you can click the QR code icon below the version number to get the QR code of the trial version mini game.

It should be noted that in addition to administrators and project members, if other personnel want to experience the "experience version" mini game, they must first add their WeChat account to the "experience members" list of the management platform "member management" . For specific operation methods, please refer to Mini Program Member Management Detailed Description.

The above-mentioned "upload to experience version" process can be uploaded multiple times during the development process. The experience versions uploaded by different developers are independent of each other. The effective experience version is subject to the "selected as the experience version" in the management platform. Every time the same developer uploads a new version, it will overwrite the old version uploaded by him. Scanning the code or entering from the existing experience version of the mobile phone will automatically update to the latest version of the experience version.

# Submit review

After the mini game is developed, it needs to be submitted for review before it can be released to the outside world.

In the Mini Program Management System "Version Management", click the "Submit for Review" button on the right side of the experience version you want to publish, and then you can submit for review after filling in the relevant form.

# Confirm release

After the version submitted for review has passed the review, you can click "Submit for release" in the "review version" to release the mini game to the outside world.