Android MOGA controller menu handling

I’m developing the menu handling for the MOGA controller in my maze game MultiMaze. When the KEYCODE_DPAD_UP button is pressed I want to change focus to the button below the current button. I had some trouble finding a nextFocus method but I’ve now found the excellent getNextFocusDownId method.

So I’ll specify a button in the XML like this:

 
    <Button
        android:id="@+id/multiplayer_button"
        android:focusable="true"
        android:focusableInTouchMode="true"

        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/singleplayer_button"
        android:text="@string/main_menu_multiplayer_text"/>

Then when I detect a DPAD_UP signal I’ll focus the button above with the following code:

Button upButton = (Button)findViewById(multiplayerButton.getNextFocusUpId());
upButton.requestFocus();

Android MOGA Game controller implementation

I’ve started looking on implementing the MOGA game controller to MultiMaze!

To get something working I ripped out the controller logic from a sample project downloaded from here
controller-sdk-std-1.3.1 2/controller-sdk-std-1.3.0.130201/controller-sdk-std/samples/com.bda.controller.example.demo.listen

Now I’m not using the standard Android InputDevice method but a MOGA library. My dream was to implement the MOGA controller and then MultiMaze would kind-of support all controllers but this will not be the case with this solution.

So I got the actual game logic to work with the controller, i.e. moving north, east, south, west, up, down and back, using the D(irectional)-PAD and the A(up/down) and B(back) buttons. Now I’ve got to make a nice solution so that the user can also navigate the menus and dialogs.

Progress so far:

Good MOGA Pro Controller FAQ

Here’s a good intro to Android game controllers:

MultiMaze new version released!

Finally, nine months after the last release, MultiMaze has a new release. And what a release! New features:

  • Google Play Games Achievements, with auto sync for achievements taken when not signed in
  • Google Play Games Leaderboard, the one with the most completed mazes reigns the leaderboard
  • Android Cloud Save, sync progress to the cloud so that you can play the game across several devices (and not lose progress)
  • Setup multiplayer sessions with NFC
  • Splash screen featuring Lundi Software
  • New player graphics (blue cape for player 2)

There’s also work done to get the long awaited third level, but I’ll come in the next big release together with Google Play Games Realtime Multiplayer support!

Download MultiMaze on Google Play

Transforming DrawableAnimation Android

Today I added a flash screen to MultiMaze. On the screen I wanted to have a MultiMaze “player” run across the screen. This is how I achieved it:

// Animate the players fluttering cape
ImageView playerImageView = (ImageView)this.findViewById(R.id.player);
AnimationDrawable playerFlutterAnimation = new AnimationDrawable();
Drawable p1 = this.getResources().getDrawable(R.drawable.player_1);
Drawable p2 = this.getResources().getDrawable(R.drawable.player_2);
playerFlutterAnimation.addFrame(p1, 200);
playerFlutterAnimation.addFrame(p2, 200);
playerFlutterAnimation.setOneShot(false);
playerImageView.setImageDrawable(playerFlutterAnimation);
playerFlutterAnimation.start();

// Animate player movement from left to right
ObjectAnimator playerMoveAnimation = 
   ObjectAnimator.ofFloat(playerImageView, "translationX", -100f, 1000f);
playerMoveAnimation.setDuration(3000);
playerMoveAnimation.start();

The result:

China loves MultiMaze!

Got my first real user boost yesterday. Usually I have around 20 installs per day. Yesterday that number was 128! Almost all the new users come from China, so a localized version of MM in simplified Chinese is a priority now! That and an improved South Korean version. The surge of new users resulted in a new Premium purchase! A good start of the new year! :)

peak_mm

New year – project statuses

MultiMaze Android game

Throughout the fall and winter I’ve been implementing Google Play Games Services to add leaderboards and achievements to the game. To get it working was quite simple but as always there are special cases to be dealt with that’s causing “delays”. For instance, the player must be signed in to Google Plus in the app to be able to unlock achievements but if the player unlocks achievements while not logged in the player’ll want to unlock them the next time he/she logs in!

I’ve also added NFC setup of Bluetooth sessions! It’s pretty damn cool!

Future tasks: Add Play Games Realtime-multiplayer support. SHOULD not be that hard but there’ll obviously be hard cases I haven’t thought about… Also, I’d like to add sound effects and a soundtrack to the game. The other major task is to add a third level to the game – the lava-level! :D

Sundsvall ÅVC Android app

Before christmas I released a new version of the app with improved notifications for when it’s time to roll out the garbage containers. I’ve also improved the inputting of data to the server and pushing of data to GCM/clients. I’ve posted one Sundsvall ÅVC-ad on the local recycling station. No new users though.

Future tasks: Make the startup-ad in the app dynamic with images and link. Post more ads on the recycling stations in the city. :)

Project Run Sundsvall website

This fall/winter I’ve made long due improvements to the inputting of data to the server. Now it’s much easier to push a new track to the server so hopefully I’ll update my running tracks/event much more frequently in the future!

Future tasks: Add controls to the main page of the project. For example make it possible to see only the last three months or last year or a specific year and so on. It would also be nice to be able to filter on track-type (e.g. only from home to home).

GridPaint Android app

After the summer I made a total re-haul of the pattern-making-app using LibGDX (an OpenGL wrapper/library). I got cool mirroring functionality working but there were some bugs that I didn’t have the determination to push through so the project is put on hold…

Rubic’s cube – solving the last layer

Let’s solve the last layer of the Rubic’s cube!

In previous posts I show how we can solve the cube:
Post 1 – First layer
Post 2 – Algorithm explanation
Post 3 – Using the algorithms (layer 2)

In this, the last post, I’ll show you how to solve the last and hardest layer.

1. Create a yellow cross in the last layer using the algorithm:
FURU’R’F’
if you have the following placement of yellow bits:
2012-09-26 14.36.11or using
FRUR’U’F’
if you have the following yellow placements:
2012-09-26 14.36.27
2. Place the four corner bits on the correct places using:
LU’R’UL’U’RU2
2012-09-26 14.36.59
3. Flip three corners up to complete the yellow layer using:
R’U’RU’R’U2RU2
2012-09-26 14.39.58
or
RUR’URU2R’U2
2012-09-26 14.39.18
4. Fix the middle pieces in the last layer by applying:
R2UFB’R2F’BUR2
2012-09-26 14.41.19