A method of controlling a game character through python code, and an electronic device

A game character and code control technology, applied in indoor games, video games, creating/generating source codes, etc., can solve problems such as cumbersome steps and easy crashes of web games, and achieve the effect of saving time and improving efficiency

Active Publication Date: 2019-01-15
SHENZHEN DIANMAO TECH CO LTD
View PDF12 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0006] In view of the above-mentioned deficiencies in the prior art, the object of the present invention is to provide a method and electronic equipment for controlling game characters through python codes, aiming to solve the problems in the prior art that the browser executes python codes with cumbersome steps and the browser runs web games easily crash

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A method of controlling a game character through python code, and an electronic device
  • A method of controlling a game character through python code, and an electronic device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0037] The present invention provides a method and electronic equipment for controlling game characters through python codes. In order to make the purpose, technical solutions and effects of the present invention clearer and clearer, the present invention will be further described in detail below. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

[0038] see figure 1 , a method for controlling game characters through python codes, comprising steps:

[0039] S1. When receiving a request from a user to input python code, display a corresponding python code editor;

[0040] S2, when the user inputs the operation of python code in python code editor, judge whether the python code of input comprises loop statement code, when the python code of input comprises loop statement code, then insert sleep function in described loop statement code, Get the target python code;

[0041] ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method for controlling game characters through python codes and an electronic device. The method comprises the following steps: when receiving a request for inputting pythoncodes by a user, displaying a corresponding python code editor; when a user enters the operation of python code in the python code editor, judging whether the input python code contains a loop statement code, and when the input python code contains a loop statement code, inserting a sleep function into the loop statement code to obtain a target python code; translating the target python code intojs code; sequentially execute each line of js code, and when executing the js code of the current line, pausing executing the js code of the next line, and calling the game character behavior interface to control the game character to implement the corresponding action; if the js code of the current line is finished, continuing executing the js code of the next line. As that dormant function is inserted into the code of the loop statement, the browser does not collapse when the web page game is run.

Description

technical field [0001] The invention relates to the field of communication technology, in particular to a method and electronic equipment for controlling game characters through python codes. Background technique [0002] Because web games do not need to install game clients, and have the characteristics of small memory and convenience, web games are accepted by a large number of users. Moreover, it has a tendency to gradually replace traditional client games. [0003] However, in the prior art, the browser can execute (run) the js code, but cannot execute the python code, so it is necessary to export the python code written by the browser to an external storage device, compile it into js code, and then transfer it to the browser Execution, this step process is cumbersome and inefficient. [0004] Moreover, when the web game is running, if the action of the game character is repeated frequently, it is easy to cause the browser to crash, and the next action (the action of t...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & AuthorityApplications(China)
IPC IPC(8): A63F13/55G06F8/30
CPCA63F2300/65A63F13/55G06F8/30
Inventor孙悦李天驰何耀
OwnerSHENZHEN DIANMAO TECH CO LTD