What do you mean with points? I guess you can create an object, get its x and y value and store it in a globlal Js namespace, if your app is in Js. How do you plan to create your app exactly? Wich technologies will be involved?
When I say points I mean the game score, if I can get that score so I can use it to give trophies for example in the app.
The app is already up and working, it’s an Android app.
In the app we have a quiz, and you win points by completing this quiz. Then you can use those points to get discounts in our store.
If I export it in html5 I guess a webview should be fine.
I noticed that there is an action that let you save a json with the value of a variable, I haven’t figured it out yet
It’s for PC only, that won’t do the job. The way to go is in my opinion are Javascript Interfaces. Create a class like this:
public class JavaScriptInterface {
Context mContext;
/** Instantiate the interface and set the context */
JavaScriptInterface(Context c) {
mContext = c;
}
/** Show a toast from the web page */
@JavascriptInterface
public void showToast(String toast) {
Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();
}
}
To create an interface. Then, use something like this in your webview:
Where the second argument is the namespace you attribute in the Js environment. Then you can in GDevelop use a Js event to call the Java function from the interface, in that case like this:
Android.showToast("hello");
Use it to modify variables in your app instead to values of GDevelop variables.