Positioning method and system for music teaching foundation improvement game

文档序号:248430 发布日期:2021-11-16 浏览:42次 中文

阅读说明:本技术 一种音乐教学基础提升游戏的定位方法及系统 (Positioning method and system for music teaching foundation improvement game ) 是由 李现峰 魏宏惠 魏宏茹 于 2021-07-02 设计创作,主要内容包括:本发明属于音乐教学技术领域,特别涉及一种音乐教学基础提升游戏的定位方法及系统。本发明提供一种新的音乐教学基础提升游戏的定位方法及系统,通过遍历打谱数据的谱子中音符出现的时间间隔,获取最小时间间隔,基于最小时间间隔以及音符的大小来计算出音符的移动速度,且通过移动速度以及音符移动到当前位置的时刻来计算当前的位移,由此对音符进行定位,该计算方式不仅适于所有的音符,还保证了计算的准确性,由于最小时间间隔只需要确定一次,且音符的大小是确定的,因此,该方式还可以提高计算速度;同时,在更新游戏时,自需要更新打谱数据即可加快了更新速度。(The invention belongs to the technical field of music teaching, and particularly relates to a positioning method and a positioning system for a music teaching basic promotion game. The invention provides a new positioning method and a system for music teaching foundation improvement games, wherein a minimum time interval is obtained by traversing the time interval of occurrence of notes in a spectrum of score data, the moving speed of the notes is calculated based on the minimum time interval and the sizes of the notes, and the current displacement is calculated by the moving speed and the time when the notes move to the current position, so that the notes are positioned; meanwhile, when the game is updated, the score data is updated according to the requirement, so that the updating speed can be increased.)

1. A positioning method for a music teaching basic promotion game is characterized by comprising the following steps:

a data acquisition step, which is used for acquiring the score data uploaded by the server in real time and storing the score data to a game end;

a time interval obtaining step for obtaining the score data and traversing the time interval of the occurrence of the musical notes in the score of the score data to obtain the minimum time interval t0

A moving speed calculating step ofCalculating each note at a minimum time interval t0Inner moving speed v, v ═ x ÷ t0Wherein x is d × n, n ≧ 1, d represents the size of the note, x represents the displacement of the note within the minimum time interval, and x refers to the pixel of the note within the minimum time interval, and n represents the parameter;

a displacement calculation step of calculating a preformed displacement S when the note is moved to the specified position based on the moving velocity, where S represents a time when the note is moved to the specified position;

a comparison step, which is used for receiving a starting instruction and a triggering instruction of knocking the keyboard, comparing the displacement of the appointed musical note when moving to the current position with the prefabricated displacement when moving to the appointed position after receiving the triggering instruction, and calculating a score according to the comparison result;

a note displaying step for displaying the moved note and the comparison result in the comparing step on a display.

2. The method of claim 1, wherein the step of comparing comprises the step of calculating the displacement of the specified note when it moves to the current position as follows:

an initial position collecting step, which is used for collecting and storing the initial position of the appointed musical note when a starting instruction of knocking the keyboard is received;

a current position acquisition step, which is used for acquiring and storing the current position of the appointed musical note when a trigger instruction for knocking the keyboard is received;

a calculating step, for calculating the displacement of the designated note to the current position based on the difference between the current position and the initial position of the designated note.

3. The method of claim 2, wherein the step of comparing comprises the following steps of:

a difference calculation step of calculating an absolute value of a difference between a displacement of the designated note when moved to the current position and the prefabricated displacement;

and a result comparing step of comparing the calculated absolute value of the difference with a first threshold and a second threshold, wherein the score is m if the absolute value of the difference is smaller than the first threshold, the score is n if the absolute value of the difference is larger than the first threshold and smaller than the second threshold, and the score is 0 if the absolute value of the difference is larger than the second threshold.

4. The method of claim 1, wherein the step of calculating the displacement includes instantiating the pre-fabricated displacement after calculating the pre-fabricated displacement.

5. The method for positioning a music teaching based on a progressive game according to claim 1, wherein the data acquisition step comprises the following steps:

a mode loading step, which is used for acquiring a user id and loading a corresponding mode according to a received user mode selection instruction;

a data acquisition sub-step, which is used for sending a post request to a server end to acquire corresponding score data and storing the score data to a game end;

and an instruction storage step, which is used for storing the received user level instruction and the user id in a game terminal in a correlation manner.

6. The method for positioning a music teaching aid game according to claim 1, wherein the step of calculating the moving speed includes the steps of:

a first velocity calculating step of calculating a first moving velocity v of each note in a minimum time interval0,v0=x÷t0

A first judgment step, which is used for judging whether the moving speed of the musical note in the whole music score of the music score data is unchanged, if so, sending an instruction to the movement calculation step, and if the speed is changed, sending an instruction to the second calculation step;

a second velocity calculating step for traversing the spectral consonants of the score dataTime interval of symbol occurrence, obtaining time interval t1,t1>t0And t is1Calculating each note at time interval t less than the remaining time interval1Moving speed v of1,v1=x÷t1

7. The method for locating a music teaching aid game according to claim 6, wherein said second velocity calculating step includes the steps of:

a second judging step, which is used for judging whether the moving speed change times of the musical notes in the whole music score of the music score data exceeds one time, if not, sending an instruction to the first processing step, and if so, sending an instruction to the second processing step;

a first processing step for traversing the time interval of occurrence of notes in the spectrum of the score data to obtain a time interval t1According to t1Calculating the moving velocity v1Then, sending an instruction to the displacement calculation step;

a second processing step, for traversing the time interval of occurrence of musical notes in the spectrum of the score data, and obtaining the time interval t1、t2、......、tnWherein, t1<t2<......<tnAnd t isnLess than the remaining time interval, and calculating t respectively1、t2、......、tnCorresponding moving speed v1、v2、......、vnThereafter, an instruction is sent to the displacement calculation step.

8. The method of claim 7, wherein the step of calculating the displacement comprises the steps of:

a third determination step of determining whether or not the number of changes in the moving velocity is less than 1 in the moving velocity calculation step, and if so, directly calculating a preliminary displacement S when the note is moved to the specified position, S being a time T × v at which the note is moved to the specified position0If not, sending an instruction to the moment determining step;

a time determining step for determining an initial time and a termination time of each movement speed change of the note from the initial position to the specified position;

a displacement calculation step for calculating a displacement based on each moving speed v1、v2.nRespectively calculating corresponding displacements S1、S2.n,S1=(T11-T01)×v1Wherein, T01、T11Indicating a change in the speed of movement to v1Initial and end times of (S)2.nThe calculation formula of (2) is analogized in the same way;

a prefabricated displacement calculation step for calculating prefabricated displacement S of each displacement calculation note moving to the designated positionPreparation of,SPreparation of=S1+S2+...+Sn

9. A positioning system for a music teaching base up game comprising a memory, a processor and a computer program stored on the memory, wherein the processor executes the computer program to perform the steps of the method of claim 1.

10. The system for locating a music teaching aid game according to claim 9, comprising:

the data acquisition module (1) is used for acquiring the score printing data uploaded by the server in real time and storing the score printing data to the game terminal;

a time interval obtaining module (2) for calling the score data and traversing the time interval of the occurrence of the musical notes in the score of the score data to obtain the minimum time interval t0

A movement velocity calculation module (3) for calculating the minimum time interval t of each note0Inner moving speed v, v ═ x ÷ t0Wherein x is d × n, n ≧ 1, d represents the size of the note, x represents the displacement of the note within the minimum time interval, and x refers to the pixel of the note within the minimum time interval, and n represents the parameter;

a displacement calculation module (4) for calculating a prefabricated displacement S when the note moves to the designated position based on the moving speed, wherein S represents the time when the note moves to the designated position;

the comparison module (5) is used for receiving a starting instruction and a triggering instruction of knocking the keyboard, comparing the displacement of the appointed musical note when the appointed musical note moves to the current position with the prefabricated displacement when the appointed musical note moves to the appointed position after the triggering instruction is received, and calculating a score according to a comparison result;

a note display module (6) for displaying the moved notes and the comparison result in the comparison step on a display;

preferably, in the comparison module (5), the displacement of the specified note when moving to the current position is calculated as follows:

an initial position collecting unit (51) for collecting and storing an initial position of a designated note when a start instruction of striking a keyboard is received;

the current position acquisition unit (52) is used for acquiring and storing the current position of the appointed musical note when a trigger instruction for knocking the keyboard is received;

a calculating unit (53) for calculating a displacement of the specified note to the current position based on a difference between the current position and the initial position of the specified note;

preferably, the calculating the score according to the comparison result in the comparison module (5) specifically includes the following steps:

a difference value calculating unit (54) for calculating an absolute value of a difference value between the displacement at which the specified note is moved to the current position and the prepared displacement;

a result comparing unit (55) for comparing the calculated absolute value of the difference with a first threshold value and a second threshold value, wherein the score is m if the absolute value of the difference is smaller than the first threshold value, n if the absolute value of the difference is larger than the first threshold value and smaller than the second threshold value, and 0 if the absolute value of the difference is larger than the second threshold value;

preferably, in the displacement calculation module (4), after the prefabricated displacement is calculated, the prefabricated displacement is instantiated;

preferably, the data acquisition module (1) specifically includes the following components:

the mode loading unit (11) is used for acquiring a user id and loading a corresponding mode according to a received user mode selection instruction;

the data acquisition unit (12) is used for initiating a post request to the server end to acquire corresponding score data and storing the score data to the game end;

the instruction storage unit (13) is used for associating and storing the received user level instruction with the user id to the game terminal;

preferably, the moving speed calculation module (3) includes the following parts:

first speed calculation unit (31): for calculating a first moving velocity v0, v0 ═ x ÷ t0 of each note in a minimum time interval;

the first judging unit (32) is used for judging whether the moving speed of the notes in the whole music score of the music score data is constant or not, if so, an instruction is sent to the step of calculating the movement, and if the speed is changed, the instruction is sent to the step of calculating the second movement;

a second velocity calculating unit (33) for traversing a time interval during which notes appear in a bin of the score data, obtaining a time interval t1, t1> t0, and t1 being smaller than the remaining time interval, calculating a moving velocity v1, v1 ═ x ÷ t1 of each note at the time interval t 1;

preferably, the second speed calculation unit (33) includes:

the second judgment submodule (331) is used for judging whether the moving speed change times of the notes in the whole music score of the music score data exceeds one time, if not, sending an instruction to the first processing step, and if so, sending an instruction to the second processing step;

the first processing submodule (332) is used for traversing the time interval of occurrence of notes in a spectrum of the score data, acquiring the time interval t1, calculating the moving speed v1 according to t1, and sending an instruction to the step of calculating the displacement;

a second processing submodule (333) for traversing time intervals of occurrence of notes in a spectrum of the beat spectrum data, acquiring time intervals t1, t2,. and.. eta, tn, wherein t1< t2<. eta.. eta. < tn, and tn is less than the rest time intervals, and sending an instruction to the displacement calculation step after calculating the movement speeds v1, v2,. and.. eta., tn corresponding to t1, t2,. and.. eta., tn, respectively;

preferably, the displacement calculation module (4) comprises the following parts:

a third judging unit (41) for judging whether the number of changes of the moving velocity is less than 1 in the moving velocity calculating step, if yes, directly calculating the prefabricated displacement S when the note moves to the designated position, wherein S is the time T multiplied by v0 when the note moves to the designated position, and if not, sending an instruction to the time determining step;

a time determination unit (42) for determining an initial time and a termination time of the note each time the moving speed is changed between the initial position to the specified position;

a displacement calculation unit (43) for calculating a corresponding displacement S1, S2, a.. or Sn based on each moving speed v1, v2, or vn, respectively, S1 ═ T11-T01 × v1, where T01, T11 represent an initial time and a termination time at which the moving speed changes to v1, and a calculation formula of S2, a.. or Sn, and so on;

and a prefabricated displacement calculation unit (44) for calculating prefabricated displacements SPrep, S-Prep-S1 + S2+. + Sn, of each displacement calculation note moving to the designated position.

Technical Field

The invention belongs to the technical field of music teaching, and particularly relates to a positioning method and a positioning system for a music teaching basic promotion game.

Background

The existing game needs to update the whole game when data is updated, the updating speed is slow, and when the positions of the notes are positioned, steps of collecting the displacement and time of all the notes and calculating the speed are needed, so that the positioning steps are complex, and the accuracy is influenced.

Disclosure of Invention

In order to solve the problems, the invention provides a novel positioning method and system for a music teaching basic promotion game.

The specific technical scheme of the invention is as follows:

the invention provides a music teaching foundation promotion game method, which comprises the following steps:

a data acquisition step, which is used for acquiring the score data uploaded by the server in real time and storing the score data to a game end;

a time interval obtaining step for obtaining the score data and traversing the time interval of the occurrence of the musical notes in the score of the score data to obtain the minimum time interval t0

A step of calculating the velocity of movement for calculating the minimum time interval t of each note0Inner moving speed v, v ═ x ÷ t0Wherein x is d × n, n ≧ 1, d represents the size of the note, x represents the displacement of the note within the minimum time interval, and x refers to the pixel of the note within the minimum time interval, and n represents the parameter;

a displacement calculation step of calculating a preformed displacement S when the note is moved to the specified position based on the moving velocity, where S represents a time when the note is moved to the specified position;

a comparison step, which is used for receiving a starting instruction and a triggering instruction of knocking the keyboard, comparing the displacement of the appointed musical note when moving to the current position with the prefabricated displacement when moving to the appointed position after receiving the triggering instruction, and calculating a score according to the comparison result;

a note displaying step for displaying the moved note and the comparison result in the comparing step on a display.

A positioning system for a music teaching base up game comprising a memory, a processor and a computer program stored on the memory, the processor executing the computer program to perform the steps of the method of claim 1.

The invention has the following beneficial effects:

the invention provides a new positioning method and a system for music teaching foundation improvement games, wherein a minimum time interval is obtained by traversing the time interval of occurrence of notes in a spectrum of score data, the moving speed of the notes is calculated based on the minimum time interval and the sizes of the notes, and the current displacement is calculated by the moving speed and the time when the notes move to the current position, so that the notes are positioned; meanwhile, when the game is updated, the score data is updated according to the requirement, so that the updating speed can be increased.

Drawings

FIG. 1 is a flow diagram of a method for locating a music teaching base up game in some embodiments;

FIG. 2 is a flow chart of steps S51-53 in some embodiments;

FIG. 3 is a flowchart illustrating steps S54-55 according to an embodiment;

FIG. 4 is a flow chart of the data acquisition step in some embodiments;

FIG. 5 is a flow chart of the moving speed calculation step in some embodiments;

FIG. 6 is a flow chart of a second speed calculation step in some embodiments;

FIG. 7 is a flow chart of the displacement calculation step in some embodiments;

FIG. 8 is a block diagram showing a positioning method of a music teaching base up game according to another embodiment;

FIG. 9 is a block diagram of an alignment module according to another embodiment;

FIG. 10 is a block diagram of a data acquisition module in another embodiment;

fig. 11 is a block diagram showing the structures of a moving speed calculating module and a displacement calculating module in another embodiment.

Detailed Description

The present invention will be described in further detail with reference to the following examples and drawings.

In some embodiments, the present invention provides a method for positioning a music teaching base up game, as shown in fig. 1, including the following steps:

s1: a data acquisition step, which is used for acquiring the score data uploaded by the server in real time and storing the score data to a game end;

s2: a time interval obtaining step for obtaining the score data and traversing the time interval of the occurrence of the musical notes in the score of the score data to obtain the minimum time interval t0

S3: a moving velocity calculating step of calculating a moving velocity v, v ═ x ÷ t of each note in a minimum time interval t00Where x ═ d × n, n ≧ 1, d denotes the size of the note, x denotes the displacement of the note within the minimum time interval, and x denotes the pixel of the note within the minimum time interval, n denotes a parameter, n is preferably 1.5;

s4: a displacement calculation step of calculating a preformed displacement S when the note is moved to the specified position based on the moving velocity, where S represents a time when the note is moved to the specified position;

s5: a comparison step, which is used for receiving a starting instruction and a triggering instruction of knocking the keyboard, comparing the displacement of the appointed musical note when moving to the current position with the prefabricated displacement when moving to the appointed position after receiving the triggering instruction, and calculating a score according to the comparison result;

s6: a note displaying step for displaying the moved note and the comparison result in the comparing step on a display.

The invention provides a new positioning method of a music teaching foundation promotion game, which is characterized in that a minimum time interval is obtained by traversing the time interval of occurrence of notes in a spectrum of score data, the moving speed of the notes is calculated based on the minimum time interval and the sizes of the notes, and the current displacement is calculated by the moving speed and the time when the notes move to the current position, so that the notes are positioned; meanwhile, when the game is updated, the score data is updated according to the requirement, so that the updating speed can be increased.

As shown in fig. 2, in the comparing step in this embodiment, the step of calculating the displacement when the specified note moves to the current position is as follows:

s51: an initial position collecting step, which is used for collecting and storing the initial position of the appointed musical note when a starting instruction of knocking the keyboard is received;

s52: a current position acquisition step, which is used for acquiring and storing the current position of the appointed musical note when a trigger instruction for knocking the keyboard is received;

s53: a calculating step, for calculating the displacement of the designated note to the current position based on the difference between the current position and the initial position of the designated note.

In this embodiment, when calculating the displacement of the designated note when moving to the designated position, pixels of the designated note at the initial position and pixels of the designated note moving to the current position need to be collected respectively, the displacement of the designated note moving to the current predetermined position in the actual game can be calculated based on the difference between the two pixels, and the game result can be known based on the comparison between the actual displacement and the prefabricated displacement; the note pixel acquisition method comprises the following steps: offset Left acquires the Left margin, which is in pixels.

As shown in fig. 3, in the comparing step in this embodiment, the calculating the score according to the comparison result specifically includes the following steps:

s54: a difference calculation step of calculating an absolute value of a difference between a displacement of the designated note when moved to the current position and the prefabricated displacement;

s55: and a result comparing step of comparing the calculated absolute value of the difference with a first threshold and a second threshold, wherein the score is m if the absolute value of the difference is smaller than the first threshold, the score is n if the absolute value of the difference is larger than the first threshold and smaller than the second threshold, and the score is 0 if the absolute value of the difference is larger than the second threshold.

In this embodiment, the comparing step is used to determine the game result and determine the score of the game according to the game result, and when determining the game result, the absolute value of the difference is compared with the threshold, for example, the first threshold is 0.2, the second threshold is 0.5, m is 5, n is 2, and it indicates that when playing the game and tapping the keyboard to trigger the note, the accuracy of the note position needs to be less than 0.2 to obtain a full score of 5, when the accuracy is less than 0.5, only 2 can be obtained, and when greater than 0.5, it indicates that when tapping the keyboard, the designated note has moved out of the designated position, i.e. missed, and only 0 score can be obtained.

In the displacement calculation step in this embodiment, after the prefabricated displacement is calculated, the prefabricated displacement is instantiated.

As shown in fig. 4, the data acquiring step in this embodiment specifically includes the following steps:

s11: a mode loading step, which is used for acquiring a user id and loading a corresponding mode according to a received user mode selection instruction;

s12: a data acquisition sub-step, which is used for sending a post request to a server end to acquire corresponding score data and storing the score data to a game end;

s13: and an instruction storage step, which is used for storing the received user level instruction and the user id in a game terminal in a correlation manner.

In an actual game, the following parts are specifically included:

1.1 front Page

Acquiring a user Id;

receiving an instruction of a player to select an exercise mode and loading the exercise mode, wherein the loading step comprises the following steps:

1.2 level List

1) Loading list data, and initiating a post request to a back end to acquire checkpoint data;

2) the list display level data comprises:

instantiating a pre-manufactured resource;

adding the prefabricated resource to the father node and updating the content;

1.3 Game scenes

1) Calculating the moving speed of the notes according to the duration of the notes and the time points of the notes

V/traverse the Note appearance time Interval to get minimum time Interval

minTime=Math.min(minTime,time);

V/calculating the velocity of movement of the note by assuming a displacement of 1.5 times the actual size of the note within the minimum time interval

this.symbolMoveSpeed=this.symbolWidth*1.5/minTime;

2) Computing note displacements and instantiating pre-fabricated resources

v/Note Displacement is the time when a note occurs x velocity of note movement

this.symbolPosition[i]=this.symbol[i]*this.symbolMoveSpeed;

V/instantiating a prefabricated resource

this.instantiateSymbol(this.symbolPosition[this.currentNodeId],this.symbolMoveSpeed,lastDuration);

3) Adding scores according to the positions of the triggered notes of the players in the game process, wherein the scores are 5 points for perfect, 2 points for great, and miss are not scored;

gainScore(score)

adding continuous impact: batter (score)

4) The game ends when the current level notes are all completed or spent, and the player may choose to continue the game to return to the game list or resume the current level.

As shown in fig. 5, the moving speed calculating step in this embodiment includes the following steps:

s31: a first velocity calculating step of calculating a first moving velocity v of each note in a minimum time interval0,v0=x÷t0

S32: a first judgment step, which is used for judging whether the moving speed of the musical note in the whole music score of the music score data is unchanged, if so, sending an instruction to the movement calculation step, and if the speed is changed, sending an instruction to the second calculation step;

s33: a second velocity calculating step for traversing the time interval of occurrence of musical notes in the spectrum of the score data to obtain a time interval t1,t1>t0And t is1Calculating each note at time interval t less than the remaining time interval1Moving speed v of1,v1=x÷t1

As shown in fig. 6, the second speed calculation step in this embodiment includes the following steps:

s331: a second judging step, which is used for judging whether the moving speed change times of the musical notes in the whole music score of the music score data exceeds one time, if not, sending an instruction to the first processing step, and if so, sending an instruction to the second processing step;

s332: a first processing step for traversing the time interval of occurrence of notes in the spectrum of the score data to obtain a time interval t1According to t1Calculating the moving velocity v1Then, sending an instruction to the displacement calculation step;

s333: a second processing step, for traversing the time interval of occurrence of musical notes in the spectrum of the score data, and obtaining the time interval t1、t2、......、tnWherein, t1<t2<......<tnAnd t isnLess than the remaining time interval, and calculating t respectively1、t2、......、tnCorresponding moving speed v1、v2、......、vnThereafter, an instruction is sent to the displacement calculation step.

As shown in fig. 7, the displacement calculating step in this embodiment includes the following steps:

s41: a third determination step of determining whether or not the number of changes in the moving velocity is less than 1 in the moving velocity calculation step, and if so, directly calculating a preliminary displacement S when the note is moved to the specified position, S being a time T × v at which the note is moved to the specified position0If not, sending an instruction to the moment determining step;

s42: a time determining step for determining an initial time and a termination time of each movement speed change of the note from the initial position to the specified position;

s43: a displacement calculation step for calculating a displacement based on each moving speed v1、v2.nRespectively calculating corresponding displacements S1、S2.n,S1=(T11-T01)×v1Wherein, T01、T11Indicating a change in the speed of movement to v1Initial and end times of (S)2.nThe calculation formula of (2) is analogized in the same way;

s44: a prefabricated displacement calculation step for calculating prefabricated displacement S of each displacement calculation note moving to the designated positionPreparation of,SPreparation of=S1+S2+...+Sn

In this embodiment, in the whole spectrum of the score data, the velocity of the note may change, and at this time, the magnitude of each moving velocity of the note needs to be calculated, and then the corresponding displacement is calculated according to the magnitude of each moving velocity, and the prefabricated displacement of the variable-speed note is calculated according to the magnitude of each moving velocity; in calculating the moving velocity, it is necessary to determine the number of velocity changes first, then traverse the time interval during which the notes appear in the spectrum, obtain the minimum time interval, the sub-small time interval, etc., the number of time intervals obtained corresponding to the number of velocity changes, and then calculate the velocity based on v ═ x ÷ t0Calculating each moving speed, theoretically determining the time corresponding to each speed, multiplying the time and the speed to obtain a displacement, adding each phase to obtain a prefabricated displacement, wherein the determined time of each speed is the time before reaching a specified position, and if a speed can correspond to more than one time interval, calculating the displacement of the time interval corresponding to the speed respectively.

A positioning system for a music teaching base up game comprising a memory, a processor and a computer program stored on the memory, the processor executing the computer program to perform the steps of the method of claim 1.

In another embodiment, the present invention provides a positioning system for a music teaching base up game, as shown in fig. 8, including the following components:

the data acquisition module 1 is used for acquiring the score printing data uploaded by the server in real time and storing the score printing data to the game terminal;

a time interval obtaining module 2, configured to call the score data, traverse the time interval of occurrence of the musical notes in the score of the score data, and obtain a minimum time interval t0

A moving velocity calculating module 3 for calculating the moving velocity v, v ═ x ÷ t of each note in the minimum time interval t00Wherein x is d × n, n ≧ 1, d represents the size of the note, x represents the displacement of the note within the minimum time interval, and x refers to the pixel of the note within the minimum time interval, and n represents the parameter;

the displacement calculation module 4 is used for calculating a prefabricated displacement S when the note moves to the specified position based on the moving speed, wherein S represents the time when the note moves to the specified position;

the comparison module 5 is used for receiving a starting instruction and a triggering instruction for knocking the keyboard, comparing the displacement of the appointed musical note when the appointed musical note moves to the current position with the prefabricated displacement when the appointed musical note moves to the appointed position after receiving the triggering instruction, and calculating a score according to a comparison result;

the note display module 6 is used for displaying the moved notes and the comparison result in the comparison step in a display;

the invention provides a new positioning system of a music teaching foundation promotion game, which obtains a minimum time interval by traversing the time interval of occurrence of notes in a spectrum of score data, calculates the moving speed of the notes based on the minimum time interval and the sizes of the notes, and calculates the current displacement by the moving speed and the time when the notes move to the current position, thereby positioning the notes, wherein the calculation mode is not only suitable for all the notes, but also ensures the calculation accuracy, and because the minimum time interval only needs to be determined once and the sizes of the notes are determined, the mode can also improve the calculation speed; meanwhile, when the game is updated, the score data is updated according to the requirement, so that the updating speed can be increased.

As shown in fig. 9, in the comparison module 5 of this embodiment, the displacement of the specified note when moving to the current position is calculated as follows:

an initial position collecting unit 51 for collecting and storing an initial position of a designated note when a start instruction for striking a keyboard is received;

a current position collecting unit 52, configured to collect and store a current position of a specified note when a trigger instruction for tapping a keyboard is received;

a calculating unit 53 for calculating a displacement of the specified note to move to the current position based on a difference between the current position and the initial position of the specified note;

in this embodiment, when calculating the displacement of the designated note when moving to the designated position, the pixels of the designated note at the initial position and the pixels of the designated note when moving to the current position are respectively collected, the displacement of the designated note when moving to the current predetermined position in the actual game can be calculated based on the difference between the two pixels, and the game result can be known by comparing the actual displacement with the preset displacement

As shown in fig. 9, in the comparison module 5 in this embodiment, calculating the score according to the comparison result specifically includes the following steps:

a difference calculation unit 54 for calculating an absolute value of a difference between the displacement at which the specified note is moved to the current position and the prepared displacement;

a result comparing unit 55, configured to compare the absolute value of the calculated difference with a first threshold and a second threshold, where the score is m if the absolute value of the difference is smaller than the first threshold, the score is n if the absolute value of the difference is larger than the first threshold and smaller than the second threshold, and the score is 0 if the absolute value of the difference is larger than the second threshold;

in this embodiment, the comparing step is used to determine the game result and determine the score of the game according to the game result, and when determining the game result, the absolute value of the difference is compared with the threshold, for example, the first threshold is 0.2, the second threshold is 0.5, m is 5, n is 2, and it indicates that when playing the game and tapping the keyboard to trigger the note, the accuracy of the note position needs to be less than 0.2 to obtain a full score of 5, when the accuracy is less than 0.5, only 2 can be obtained, and when greater than 0.5, it indicates that when tapping the keyboard, the designated note has moved out of the designated position, i.e. missed, and only 0 score can be obtained.

In the displacement calculation module 4 in this embodiment, after the prefabricated displacement is calculated, the prefabricated displacement is instantiated;

as shown in fig. 10, the data obtaining module 1 in this embodiment specifically includes the following components:

the mode loading unit 11 is used for acquiring a user id and loading a corresponding mode according to a received user mode selection instruction;

the data acquisition unit 12 is configured to initiate a post request to the server to acquire corresponding score data, and store the score data to the game end;

the instruction storage unit 13 is used for associating and storing the received user level instruction with the user id to the game terminal;

in an actual game, the following parts are specifically included:

1.1 front Page

Acquiring a user Id;

receiving an instruction of a player to select an exercise mode and loading the exercise mode, wherein the loading step comprises the following steps:

1.2 level List

1) Loading list data, and initiating a post request to a back end to acquire checkpoint data;

2) the list display level data comprises:

instantiating a pre-manufactured resource;

adding the prefabricated resource to the father node and updating the content;

1.3 Game scenes

1) Calculating the moving speed of the notes according to the duration of the notes and the time points of the notes

V/traverse the Note appearance time Interval to get minimum time Interval

minTime=Math.min(minTime,time);

V/calculating the velocity of movement of the note by assuming a displacement of 1.5 times the actual size of the note within the minimum time interval

this.symbolMoveSpeed=this.symbolWidth*1.5/minTime;

2) Computing note displacements and instantiating pre-fabricated resources

v/Note Displacement is the time when a note occurs x velocity of note movement

this.symbolPosition[i]=this.symbol[i]*this.symbolMoveSpeed;

V/instantiating a prefabricated resource

this.instantiateSymbol(this.symbolPosition[this.currentNodeId],this.symbolMoveSpeed,lastDuration);

3) Adding scores according to the positions of the triggered notes of the players in the game process, wherein the scores are 5 points for perfect, 2 points for great, and miss are not scored;

gainScore(score)

adding continuous impact: batter (score)

4) The game ends when the current level notes are all completed or spent, and the player may choose to continue the game to return to the game list or resume the current level.

As shown in fig. 11, the moving speed calculating module 3 in this embodiment includes the following parts:

first speed calculation unit 31: for calculating a first velocity v of movement of each note within a minimum time interval0,v0=x÷t0

A first judging unit 32, configured to judge whether a moving speed of a note in the entire score of the score data is constant, if so, send an instruction to the step of calculating a displacement, and if there is a change in the speed, send an instruction to the second step of calculating;

a second velocity calculating unit 33 for traversing the time interval of occurrence of notes in the spectrum of the score data to obtain a time interval t1,t1>t0And t is1Calculating each note at time interval t less than the remaining time interval1Moving speed v of1,v1=x÷t1

The second speed calculation unit 33 in this embodiment includes the following components:

the second judging submodule 331 is configured to judge whether the number of times of change in the moving speed of the musical note in the whole score of the score data exceeds one, and if not, send an instruction to the first processing step, and if so, send an instruction to the second processing step;

a first processing submodule 332 for traversing the time interval of occurrence of notes in a spectrum of the score data to obtain a time interval t1According to t1Calculating the moving velocity v1Then, sending an instruction to the displacement calculation step;

a second processing sub-module 333, configured to traverse a time interval of occurrence of a note in a spectrum of the score data to obtain a time interval t1、t2、......、tnWherein, t1<t2<......<tnAnd t isnLess than the remaining time interval, and calculating t respectively1、t2、......、tnCorresponding moving speed v1、v2、......、vnThen, sending an instruction to the displacement calculation step;

the displacement calculation module 4 in this embodiment includes the following components:

a third determination unit 41 for determining whether the number of changes in the moving velocity is less than 1 in the moving velocity calculation step, and if so, directly calculating a preliminary displacement S when the note is moved to the specified position, S being the time T × v at which the note is moved to the specified position0If not, sending an instruction to the moment determining step;

a time determination unit 42 for determining an initial time and a termination time of the note each time the moving speed is changed between the initial position to the specified position;

a displacement calculation unit 43 for calculating a displacement based on each moving speed v1、v2.nRespectively calculating corresponding displacements S1、S2.n,S1=(T11-T01)×v1Wherein, T01、T11Indicating a change in the speed of movement to v1Initial and end times of (S)2.nThe calculation formula of (2) is analogized in the same way;

a preliminary displacement calculating unit 44 for calculating a preliminary displacement S preliminary for each displacement calculation note to move to a designated position, S preliminary being S1+S2+...+Sn

In this embodiment, in the whole spectrum of the score data, the velocity of the note may change, and at this time, the magnitude of each moving velocity of the note needs to be calculated, and then the corresponding displacement is calculated according to the magnitude of each moving velocity, and the prefabricated displacement of the variable-speed note is calculated according to the magnitude of each moving velocity; in calculating the moving velocity, it is necessary to determine the number of velocity changes first, then traverse the time interval during which the notes appear in the spectrum, obtain the minimum time interval, the sub-small time interval, etc., the number of time intervals obtained corresponding to the number of velocity changes, and then calculate the velocity based on v ═ x ÷ t0Calculating each moving speed, theoretically determining the time corresponding to each speed, multiplying the time and the speed to obtain a displacement, adding each phase to obtain a prefabricated displacement, wherein the determined time of each speed is the time before reaching a specified position, and if a speed can correspond to more than one time interval, calculating the displacement of the time interval corresponding to the speed respectively.

The above-mentioned embodiments are merely illustrative of the preferred embodiments of the present invention, and do not limit the scope of the present invention, and various modifications and improvements of the technical solution of the present invention by those skilled in the art should fall within the protection scope defined by the claims of the present invention without departing from the spirit of the present invention.

21页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:对象渲染方法和装置、存储介质及电子设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类