Mobile Terminal webpage game porting R & D framework [role model introduction]

Source: Internet
Author: User

In a game, the establishment of a role model is very important. Role attributes include: role name, title, attribute [blood, attack, defense], skill, experience value, etc, in our game, we have also added an alternative gameplay such as special techniques. Special techniques are actually a type of value. Players can use special techniques to reverse combat. Let's talk about the subject directly. After the analysis, we start from the server end. The server end should have a set of standard character setting tools. Such tools are difficult to establish at first, however, there will be a lot of requests later. Today, I will create a toolbar similar to the status bar on the game interface, allowing players to visually and conveniently view their current status information.

The server configuration tools are basically as follows:

In fact, there are a lot of settings, including skills, special skills, item packages, and a series of operations on the entire character attribute. I only cut some of the images here. Let everyone know how this game was made. After the server is configured, it is time for the client to interact with data requests on the server.

First, the main interface usually has a flag to view the status bar:

In the android interface, the UI is designed in a variety of ways. This interface should look familiar to everyone. We made it into a sector toolbar with five buttons on it, set the focus, distance, and events for each button! We set the click event in the character dialog box, but this is an interactive process. After requesting server resources, we start to configure and open a new form to display the character attributes.

View code

// Role information
Findviewbyid (R. Id. btnplayerinfo). setonclicklistener (New onclicklistener (){
@ Override
Public void onclick (view v ){

Indicator. endindicator ();
Indicator. beginindicator (TAPP. getactivity (), "querying", "querying, loading data...", R. drawable. Icon );

Thread_getuserinfo = new thread (New runnable (){
@ Override
Public void run (){
// Todo auto-generated method stub
Pui. setsend_number (usernumber );
Pui. get_gameuserinfos.run ();
If (Pui. getgetuserinfolist ()! = NULL ){
Try {
Showplayinfov ();
} Catch (exception e ){
E. printstacktrace ();
Indicator. endindicator ();
}
}
}
});
Thread_getuserinfo.start ();
}


});

In the click event, you can see a request interaction. After sending the gamer's digital account to the server for a request, you can obtain the gamer data.

It will be displayed later:

It is the basic information of the player role, including a lot of attributes, but later I found that there is no experience, and now I can make up, and the display layout is not standard enough. Simply modify the interface, and then add the parameters of the current experience value and the next experience value. Write the code in detail:

View code

<Textview Android: Id = "@ + ID/tvlevel" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content"
Android: text = "role level"/>
<Textview Android: Id = "@ + ID/tvplayername" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content"
Android: text = "role name"/>
<Textview Android: Id = "@ + ID/tvplayerchenhao" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content"
Android: text = "title"/>
<Textview Android: Id = "@ + ID/tvplayerjingxue" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content"
Android: text = "Excellent blood"

/>
<Textview Android: Id = "@ + ID/tvexp" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content"
Android: text = "current experience/upgrade experience"/>
<Textview Android: Id = "@ + ID/tvplayerattack" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content"
Android: text = "Attack Power"/>
<Textview Android: Id = "@ + ID/tvplayerdefence" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content"
Android: text = "defensive"/>
<Textview Android: Id = "@ + ID/tvplayerskill" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content"
Android: text = "special skills"/>

Then, assign values to the Code parameters:

View code

// Character level
String playlevel = playerinfo. getuserlevel ();
Settextviewtext (R. Id. tvlevel, "level:" + playlevel );
// Character experience
String nowexp = playerinfo. getexp ();
String nextexp = playerinfo. getnextexp ();
Settextviewtext (R. Id. tvexp, "Experience:" + nowexp + "/" + nextexp );

Modify the settings and check the results.

After the overall minor change, the interface will be more detailed. In the above equipment attributes, skill attributes are all buttons. After you press your finger, the attribute of the item is displayed!

Now, the character attribute interface has been introduced. In the next section, I will continue to create another status bar that displays the experience progress bar and blood bar progress bar.

Developers who like online games can join our group of 45578308. I hope you can give us valuable comments and suggestions. In the subsequent sections, I will detail the genie system and combat system. Discuss with each other. I have been entangled in the fact that my combat system is not smooth yet. I hope you can discuss it with me.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.