Summary of the invention
In view of the above problems, the object of this invention is to provide a kind of based on two method and system of accusing the mobile card of system, facilitating the follow-up problem more easily selecting card with the spacing solved by changing card.
The invention provides a kind of based on two method of accusing the mobile card of system, comprising:
Two touch point coordinates are determined by the touch point of two fingers detecting screen, if the ordinate in two touch point coordinates is in card region, determine two cards of the horizontal ordinate difference correspondence in two touch points, further, the horizontal ordinate of corresponding two cards is determined according to the horizontal ordinate in two touch point coordinates;
According to the movement of two touch point horizontal ordinates, determine mobile after the horizontal ordinate of two cards, and determine mobile after two cards horizontal ordinate between distance and mobile after the distance of horizontal ordinate respectively and between the horizontal ordinate of its edge card of closing on of two cards;
According to the distance between the horizontal ordinate of the card of two after movement, all cards between two cards after horizontally mobile; Meanwhile,
According to the distance of horizontal ordinate respectively and between the horizontal ordinate of its edge card of closing on of the card of two after movement, all cards of two cards respectively and between the card at its edge closed on after horizontally moving.
The present invention also provides a kind of based on two system of accusing the mobile card of system, comprising:
Touch point coordinate acquiring unit, two touch point coordinates are determined in the touch point for two fingers by detecting screen;
Horizontal ordinate acquiring unit, for obtaining two horizontal ordinates in described two touch point coordinates according to two touch point coordinates;
Ordinate acquiring unit, for obtaining two ordinates in two touch point coordinates according to two touch point coordinates;
Ordinate judging unit, for judging two ordinates whether in card region;
Card acquiring unit, if two ordinates are in card region, for determining two cards of the horizontal ordinate difference correspondence in two touch points, and, the horizontal ordinate of corresponding two cards is determined according to the horizontal ordinate in two touch point coordinates;
Card distance acquiring unit, for determine mobile after two cards horizontal ordinate between distance and mobile after the distance of horizontal ordinate respectively and between the horizontal ordinate of its edge card of closing on of two cards; According to the movement of two touch point horizontal ordinates, determine the horizontal ordinate of two cards after moving;
Card arrangement units, for according to the distance between the horizontal ordinate of the card of two after movement, all cards between two cards after horizontally mobile; Meanwhile,
For according to the distance of the horizontal ordinate of the card of two after movement respectively and between the horizontal ordinate of its edge card of closing on, all cards of two cards respectively and between the card at its edge closed on after horizontally mobile.
From technique scheme, provided by the invention based on two method and system of accusing the mobile card of system, following beneficial effect can be obtained:
1) described two touch point coordinates are determined by the touch point of two fingers detecting screen, determine two cards of the horizontal ordinate difference correspondence in described two touch points, according to the movement of described two touch point horizontal ordinates, determine the horizontal ordinate of described two cards after moving, and determine mobile after described two cards horizontal ordinate between distance and mobile after the distance of horizontal ordinate respectively and between the horizontal ordinate of its edge card of closing on of described two cards, again card is arranged according to these distances, thus the horizontal range that can expand conveniently by two fingers or reduce between certain region card,
2) can check the card wanted at any time, owing to can widen the distance between card, can not put the card that mistake is wanted to select, the game operation that greatly can promote player is like this experienced.
In order to realize above-mentioned and relevant object, will describe in detail and the feature particularly pointed out in the claims after one or more aspect of the present invention comprises.Explanation below and accompanying drawing describe some illustrative aspects of the present invention in detail.But what these aspects indicated is only some modes that can use in the various modes of principle of the present invention.In addition, the present invention is intended to comprise all these aspects and their equivalent.
Embodiment
Below with reference to accompanying drawing, specific embodiments of the invention are described in detail.
For the problem that player in prior art selects card more difficult, the present invention calls JS(JavaScript by browser) Programmable detection touches two points of mobile phone screen, calculate two cards of these two some correspondences, and then according to drag operation, allow the horizontal ordinate of these two cards follow finger move, other card between these two cards then with average headway horizontally between these two cards, like this can by two spacing of accusing between fabrication board, thus the spacing realized between card expands or reduction capability, conveniently check and select board.
It should be noted that, the method and system based on the mobile card of two charge system provided by the invention are not only applicable to mobile phone, are also applicable to the touch screen terminal equipment such as panel computer; Further, method and system provided by the invention is not only applicable to the movement of card, can also be used for the movement that other have the Mission Objective of arrangement architecture, such as mahjong.In following examples of the present invention illustrate, card is only a kind of game carrier for exemplary illustration, can not be considered as limitation of the invention.
Fig. 1 shows according to of the present invention based on two method flow of accusing the mobile card of system.
As shown in Figure 1, when user will control mobile card by two finger touch control manner when manipulating game, terminal browser can determine two touch point coordinates of these two touch points by two touch points (touch points of two fingers of two finger touch-control) detecting screen, if the ordinate in two touch point coordinates is in card region, determine two cards of the horizontal ordinate difference correspondence in two touch points, further, the horizontal ordinate (step S110) of corresponding two cards is determined according to the horizontal ordinate in two touch point coordinates; Then, two when moving card corresponding to user refer to action, refer to that two corresponding touch points also can be moved in the horizontal direction with two, so, in the step s 120, according to the movement of two touch point horizontal ordinates, determine mobile after the horizontal ordinate of two cards, and determine mobile after two cards horizontal ordinate between distance and mobile after the distance of horizontal ordinate respectively and between the horizontal ordinate of its edge card of closing on of two cards.
After the distance determined between two two cards referring to the correspondence after driving touch point to move and the distance respectively and between neighboring edge card thereof, in step s 130, which, just can according to the distance between the horizontal ordinate of the card of two after movement, all cards between two cards after horizontally moving.That is, according to the distance between the card of two after movement, in two determined length of interval of card of all cards between these two cards on average being arranged after movement.
Simultaneously, for the card on these two card both sides, then according to the distance of horizontal ordinate respectively and between the horizontal ordinate of its edge card of closing on of the card of two after movement, all cards of two cards respectively and between the card at its edge closed on after horizontally moving.Namely, according to the card of two after movement respectively and its close on distance between edge card, two cards of all cards between this two cards and respective edges card on average being arranged after movement are respectively respectively with in the determined length of interval of respective edges card.
Say and be noted that two cards of movement can not participate in arrangement, only follow touch point and move.
Provided by the invention based on two method of accusing the mobile card of system in order to illustrate in more detail, Fig. 2 shows the flow process of the method based on the mobile card of two charge system according to the embodiment of the present invention.
As shown in Figure 2, the method based on the mobile card of two charge system of the present embodiment comprises:
S200: whether browser calls JS Programmable detection player and use two finger to operate card, if so, performs step S210, otherwise carries out routine operation.
Wherein, when singly referring to or refer to more (not comprising two finger) operation card when player uses, the JS program that visit device calls can not carry out next step operation, and player can only carry out the conventional board that selects and operate, when only having player to use two finger to operate, the JS program that visit device calls just can carry out next step operation.
S210: detect two touch points that player presses sub-screen for the first time.
S220: the touch point coordinate obtaining two touch points, if the ordinate in two touch point coordinates is in card region, calculate two cards of the horizontal ordinate difference correspondence in two touch points, and, the horizontal ordinate of corresponding two cards of the horizontal ordinate in two touch point coordinates.
Touch point coordinate comprises horizontal ordinate and ordinate, and namely horizontal ordinate refers to x coordinate, and namely ordinate is y coordinate, and touch point coordinate is an object containing x coordinate and y coordinate two numerical value.
S230: detect the operation that player pulls two cards, and obtain two touch point coordinates of each towing.
In above-mentioned steps S230, two screen touch points that player pulls at every turn are player for the first time by two screen touch points of sub-screen, and two boards that is player carries out pulling at every turn are exactly two boards that player carries out first actuation.
The information that touch point coordinate comprises is: { the x coordinate values of touch point, the y coordinate values of touch point }
S240: according to the movement of horizontal ordinate in two the touch point coordinates pulled, obtain mobile after two touch point coordinates in horizontal ordinate, namely two cards move after horizontal ordinate.
Particularly, exemplarily, when the coordinate obtaining two touch points pulled is respectively A and B, first judge that whether the numerical value of the ordinate (i.e. y coordinate) of these two coordinate points is in card region, if exceed card region, then think that this pair refers to that operation is invalid, abandon this behaviour; The numerical value of the ordinate (i.e. y coordinate) of these two coordinate points in card region, is then considered as this pair and refers to that operation effectively.
On the effective basis of operation, the x numerical value x of two coordinate A and B is obtained in judgement two finger
1and x
2(x
1<x
2, i.e. x
1forever at x
2the left side), i.e. horizontal coordinate, JS program use x
1and the spacing of the board of left hand edge is divided by the number of the board between them, draws the spacing between each board, be average headway.
In like manner, x
1and x
2between card and x
2also calculate like this with the spacing of the card of right hand edge.
S250: the horizontal ordinate after moving according to two cards, the distance of horizontal ordinate respectively and between the horizontal ordinate of the card of its screen edge of two cards after the Distance geometry between the horizontal ordinate of two cards after calculating is mobile moves.
S260: according to the distance between two horizontal ordinates of the card of two after movement, all cards between two cards after horizontally moving with average headway, namely, in above-mentioned steps S260, the card between two cards pulled then horizontally is being passed through between two cards pulled (dividing by the range averaging between two cards) with average headway.
Wherein, the average headway computing method of often opening card between two cards after movement are: according to the distance between the card of two after movement divided by the number divided by card between them, draw the average headway often opening card between two cards after moving.
S270: the distance between the horizontal ordinate dividing the card being clipped to its screen edge according to two horizontal ordinates of the card of two after movement, two cards after horizontally mobile with average headway divide be clipped to its screen edge card between all cards.
Wherein, two cards after mobile and the average headway often opening card between its edge card equal mobile after two cards and its edge card spacing divided by the number of the card between the card of two after movement and its edge card.
That is, divide all cards be clipped between its edge card then horizontally to divide in two cards through pulling with average headway through two cards pulling to be clipped between its edge card.
In above-mentioned steps S270, in the process of all cards between two cards after horizontally moving, if the distance between the horizontal ordinate of two cards before mobile be greater than mobile after two cards horizontal ordinate between distance, then the average headway of all cards between two cards before mobile be greater than mobile after two cards between the average headway of all cards.
If the distance between the horizontal ordinate of two cards before mobile be less than mobile after two cards horizontal ordinate between distance, then the average headway of all cards between two cards before mobile be less than mobile after two cards between the average headway of all cards.
In above-mentioned steps S270, two cards after horizontally mobile divide be clipped to its screen edge card between all cards process in, if the horizontal ordinate that the horizontal ordinate of two cards after mobile divides the distance between the horizontal ordinate being clipped to its screen edge card to be greater than two cards before moving divides the distance between the horizontal ordinate being clipped to its screen edge card, the horizontal ordinate of two cards after movement divide be clipped to its screen edge card horizontal ordinate between the average headway of all cards be greater than mobile before the horizontal ordinate of two cards divide be clipped to its screen edge card horizontal ordinate between the average headway of all cards, the average headway of all cards of two cards respectively and between its edge card of closing on before also namely moving is less than the average headway of all cards of two cards respectively and between its edge card of closing on after moving.
If the horizontal ordinate that the horizontal ordinate of two cards after mobile divides the distance between the horizontal ordinate being clipped to its screen edge card to be less than two cards before moving divides the distance between the horizontal ordinate being clipped to its screen edge card, the horizontal ordinate of two cards after movement divide be clipped to its screen edge card horizontal ordinate between the average headway of all cards be less than mobile before the horizontal ordinate of two cards divide be clipped to its screen edge card horizontal ordinate between the average headway of all cards, the average headway of all cards of two cards respectively and between its edge card of closing on after the average headway of all cards of described two cards respectively and between its edge card of closing on before also namely then mobile is greater than described movement.
In order to there be one to understand more intuitively to the present invention, illustrate intuitively below with reference to the changing method of scene graph to browse mode provided by the invention.
Fig. 3 shows the scene of the acquisition touch point according to the embodiment of the present invention.
As shown in Figure 3, browser calls the touch point that two touch point t1 and t2(t1 that JS Programmable detection player presses for the first time in card games interface are the left sides, and t2 is the touch point on the right).As shown in the figure, time at the beginning, the board of all cards is apart from being average separating.
Fig. 4 shows the scene according to the corresponding card in the acquisition touch point of the embodiment of the present invention.
As shown in Figure 4, obtained the touch point coordinate of t1 and t2 by JS, calculate two card c1 and c2 that the touch point coordinate of t1 and t2 is corresponding respectively.
Fig. 5 shows and becomes large scene according to the corresponding card spacing in the touch point of the embodiment of the present invention.
As shown in Figure 5, detect the drag operation of player by JS, as detected, towing two card c1 and c2 move (in figure shown in t1 and t2 arrow) respectively to both sides, calculate card c1 and c2 move after horizontal ordinate.
So, now by the card between card c1 and c2, horizontally (namely divide by the range averaging between c1 and c2) between c1 and c2 with average headway, like this, along with the movement of two finger, distance between card c1 and c2 becomes large, and the position of the card between c1 and c2, also along with change is large, is so conveniently checked and selects the card between c1 and c2;
The board on the c1 left side, except leftmost that board c0 and c1 is motionless, other board all horizontally (divides by range averaging between c1 and c0) with average headway between c1 and c0; Board on the right of c2, except rightmost that board c20 and c2 is motionless, other board all horizontally (divides by the range averaging between c2 and c20) with average headway between c2 and c20.
Fig. 6 shows and becomes another large scene according to the corresponding card spacing in the touch point of the embodiment of the present invention.
As shown in Figure 6, the situation of the present embodiment to be c1 and c0 be the same card board, if want the board between c1 and c2, so widen the spacing of the card between c1 and c2, because c1 is edge board, no matter when edge board all can not move, so only need pull c2 to the right.
It should be noted that, if when c1 and c0 is not the same card board, also c2 can be pulled to the right, make the spacing of the card between c1 and c2 become large.
Fig. 7 shows the scene according to the corresponding card pitch smaller in the touch point of the embodiment of the present invention.
As shown in Figure 7, if want the board c1 and c2 both sides, so widen the card (also namely reducing the card between c1 and c2) on c1 and c2 both sides, so pull c1 and c2 and reduce to centre, the spacing of the card between c1 and c2 will diminish, and the board on c1 and c2 both sides is apart from just becoming large.
Fig. 8 shows the scene according to rearranging card after the playing a card of the embodiment of the present invention.
As shown in Figure 8, after player plays a card, remaining card can rearrange by average headway.
Corresponding with said method, the present invention also provides a kind of based on two system of accusing the mobile card of system.Fig. 9 shows the system based on the mobile card of two charge system according to the embodiment of the present invention.
As shown in Figure 9, the system 900 based on the mobile card of two charge system provided by the invention comprises touch point coordinate acquiring unit 910, horizontal ordinate acquiring unit 920, ordinate acquiring unit 930, ordinate judging unit 940, card acquiring unit 950, card distance acquiring unit 960, card arrangement units 970.
Wherein, touch point coordinate acquiring unit 910, two touch point coordinates are determined in the touch point for two fingers by detecting screen; Horizontal ordinate acquiring unit 920, for obtaining two horizontal ordinates in two touch point coordinates according to two touch point coordinates; Ordinate acquiring unit 930, for obtaining two ordinates in described two touch point coordinates according to two touch point coordinates; Ordinate judging unit 940, for judging two ordinates whether in card region; Card acquiring unit 950, if two ordinates are in card region, for determining two cards of the horizontal ordinate difference correspondence in two touch points, and, the horizontal ordinate of corresponding two cards is determined according to the horizontal ordinate in two touch point coordinates; Card distance acquiring unit 960, for determine mobile after two cards horizontal ordinate between distance and mobile after the distance of horizontal ordinate respectively and between the horizontal ordinate of its edge card of closing on of two cards; Card arrangement units 970, for according to the distance between the horizontal ordinate of the card of two after movement, all cards between two cards after horizontally mobile; Meanwhile, for according to the distance of the horizontal ordinate of the card of two after movement respectively and between the horizontal ordinate of its edge card of closing on, all cards of two cards respectively and between the card at its edge closed on after horizontally mobile.
Wherein, card acquiring unit comprises card horizontal ordinate corresponding unit, for determining the horizontal ordinate of corresponding card according to the horizontal ordinate in the coordinate of touch point.
Wherein, card arrangement units comprises card mean array unit, in process for all cards between two cards after horizontally moving, by all cards between the card of two after movement with between horizontal described two cards after movement of average headway; Simultaneously, in process for all cards of two cards respectively and between its edge card of closing on after horizontally mobile, by all cards of the card of two after movement respectively and between its edge card of closing on average headway horizontally two cards after movement respectively and between its edge card of closing on.
Wherein, card distance acquiring unit comprises card horizontal ordinate acquiring unit, for the movement according to two touch point horizontal ordinates, determines the horizontal ordinate of two cards after moving.
Wherein, card distance acquiring unit also comprises card distance comparing unit, for the distance between two cards before relatively mobile whether be greater than mobile after two cards between distance, meanwhile, whether the distance of two cards respectively and between its edge card of closing on after relatively moving is greater than the distance of two cards respectively and between its edge card of closing on before moving.
If the distance between described two cards before mobile is greater than the distance between described two cards after moving, then determine that the average headway of all cards between described two cards before moving is greater than the average headway of all cards between described two cards after moving;
If the distance between described two cards before mobile is less than the distance between described two cards after moving, then determine that the average headway of all cards between described two cards before moving is less than the average headway of all cards between described two cards after moving.
If the distance of described two cards respectively and between its edge card of closing on after mobile be greater than mobile before the distance of described two cards respectively and between its edge card of closing on, then determine mobile before the average headway of all cards of described two cards respectively and between its edge card of closing on be less than described movement after the average headway of all cards of two cards respectively and between its edge card of closing on;
If the distance of described two cards respectively and between its edge card of closing on after mobile be less than mobile before the distance of described two cards respectively and between its edge card of closing on, then determine mobile before the average headway of all cards of described two cards respectively and between its edge card of closing on be greater than described movement after the average headway of all cards of two cards respectively and between its edge card of closing on.
It should be noted that, system based on the mobile card of two charge system provided by the invention is by JS(JavaScript) Program Generating, in the above-described embodiments, JS(JavaScript) program is that viewed device calls, but, JS(JavaScript) and program simultaneously can also by other software or client call.
Describe in an illustrative manner according to of the present invention based on two method and system of accusing the mobile card of system above with reference to accompanying drawing.But, it will be appreciated by those skilled in the art that the method and system based on the mobile card of two charge system that the invention described above is proposed, on the basis not departing from content of the present invention, various improvement can also be made to the details that realizes wherein.Therefore, protection scope of the present invention should be determined by the content of appending claims.