flixel_mochi_750x410

Flixel & Mochi game template – update

Some users asked me to update the Flixel & Mochi game template by implementing the last versions of the Flixel and Mochiads libraries so here is a new version of the template with the game example known as Don’t Press Space 2!

Note: This tutorial is obsolete after the termination of all Mochi services, but it can be still used for a learning purpose.


 

Setup

The external libraries used in this project are:

 

The project is developed with the FlashDevelop source code editor. To successfully compile it, you have to add a proper classpath to the AdamAtomic-flixel-2_55 game library installed on your computer as follows:

  1. open project in FlashDevelop
  2. go to Project menu
  3. go to Properties
  4. go to Classpaths
  5. click on Add Classpath

 

 

Main class

The game name, default level of zoom for the game’s cameras (e.g. gameZoom = 2 : all pixels will be drawn at 2x), Mochi Game ID, game resolution and a movie clip for displaying Mochi ClickAwayAd are defined in Main.as class. Change the next lines according to the settings of your game:

 

 

Menu State class

A Mochi Click Away Ad is defined in create() function of MenuState.as class so here you can change the next highlighted lines if you want to put Click Away Ad on some other position or skip it:

 

To show a Mochi Leaderboard in the main menu screen change the next lines inside MenuState.as class according to your leaderboard settings:

 

Play State class

To send the score to the Mochi Leaderboard when the game is over change the next lines inside PlayState.as class according to your leaderboard settings:

 

 

The game example

Note: After the termination of the Mochi services, Mochi ads and leaderboard is not working anymore, but the game is still playable!


 

 


2 thoughts on “Flixel & Mochi game template – update

Leave a Reply

Your email address will not be published. Required fields are marked *