Simple Wrapper For MochiMedia Ads/Highscores

Monkey Forums/Monkey Code/Simple Wrapper For MochiMedia Ads/Highscores

JD0(Posted 2012) [#1]
Here's a wrapper for some mochimedia functionality (namely high score submission, score retrieval, login, and link creation). Sorry about the headline I guess I just used MochiMedia's encryption tool and didn't add anything for ads in the wrapper - been so long since I used this that I forgot!

Don't forget you'll need to change the ID numbers provided by Mochi within your game in the mochiwrapper.as file.

Btw, you won't be able to click any of the Mochi stuff if you execute a Print statement in your code.

I created this code 10 months ago (when I last used Monkey until a few days ago) and used it in the game Balloon Popping frenzy:

https://www.mochimedia.com/community/games/maniacdev/balloon-popping-frenzy

You can use it however you like, and ideally someone would take it and create a complete wrapper.

Just use it like any other module, you will need to add the Mochimedia API into your project's flash build folder.

The wrapper code in monkey (I placed it in modules/mochi/mochi.monkey).



The AS3 Code placed in modules/mochi/native/mochiwrapper.as:



That's all there is to it.. hopefully this helps those who want to add Mochi's functionality for Flash games. They've added achievements, and microtransactions so hopefully someone creates a more extensive wrapper.


Gerry Quinn(Posted 2012) [#2]
That looks neat! Thank you.


Aman(Posted 2012) [#3]
Good job. Will loo into it soon.


Volker(Posted 2012) [#4]
Is there a way to submit highscores?
There must be a way to set the boardID, so mochi knows
for which board the points are.
SubmitScore() takes only the points as parameter.