You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-9
Original file line number
Diff line number
Diff line change
@@ -3,21 +3,21 @@ Score and achievement API to allow HTML5 game developers to submit scores, medal
3
3
4
4
This API will allow site owners to collect scores, generate leader boards and run contests. Additionally, it will help game developers to promote their games and make them more popular.
5
5
6
-
# How to use MyArcadeScoreBridge in your HTML5 / JS games?
6
+
##How to use MyArcadeScoreBridge in your HTML5 / JS games?
7
7
8
8
There are only two simple steps to follow in order to make your game score and leader board ready.
9
9
10
-
## Step 1
10
+
###Step 1
11
11
Import 'myarcadebridge.js' into your game. You can do this in two ways:
12
12
13
-
### Option 1
13
+
####Option 1
14
14
Import the JavaScript file directly in your index.html.
15
15
16
16
```javascript
17
17
<script src="myarcadebridge.js"></script>
18
18
```
19
19
20
-
### Option 2
20
+
####Option 2
21
21
Additionally, you could load the file dynamically.
22
22
23
23
```javascript
@@ -27,10 +27,10 @@ js.src = 'myarcadebridge.js';
27
27
document.body.appendChild(js);
28
28
```
29
29
30
-
## Step 2
30
+
###Step 2
31
31
Now, you are ready to submit scores and achievements to user sites. The bridge offers you the functions `myarcade_submit_score` and `myarcade_submit_achievement`.
32
32
33
-
### Submitting scores
33
+
####Submitting scores
34
34
Many games submit achieved scores on game over but some of them offer a button to submit scores. You can use any method you like in your game. Just make sure that the scores are submitted only once.
35
35
36
36
To submit scores just call `myarcade_submit_score` and pass the achieved score to the function.
@@ -39,7 +39,7 @@ To submit scores just call `myarcade_submit_score` and pass the achieved score t
39
39
myarcade_submit_score( score );
40
40
```
41
41
42
-
### Submitting medals or achievements
42
+
####Submitting medals or achievements
43
43
In some games users are able to gain medals or achievements while playing. With MyArcadeScoreBridge you can submit achievements at any during the game play. Therefor use the function `myarcade_submit_achievement`.
44
44
45
45
In order to submit a medal or achievement you will need to create an achievement object. The object should contain following fields:
@@ -49,7 +49,7 @@ In order to submit a medal or achievement you will need to create an achievement
49
49
***score:** Score associated with this achievement
50
50
***icon:** An URL to a badge, trophy for this achievement
51
51
52
-
#### Example
52
+
#####Example
53
53
54
54
```javascript
55
55
var achievement = {
@@ -60,4 +60,8 @@ var achievement = {
60
60
};
61
61
62
62
myarcade_submit_achievement( achievement );
63
-
```
63
+
```
64
+
65
+
## How to tell users that your game is compatible with MyArcadePlugin?
66
+
67
+
In the assets/images folder, you'll find two MyArcadePlugin logos which you can embed in your games.
0 commit comments