dinsdag 16 december 2014

How to copy and compare 2D TextureRegion Arrays ?

I am working on a "simple" shuffle puzzle in which a pictures gets divided into pieces and the pieces get shuffled.
The puzzle is solved when the player manages the shuffle all the pieces back into their original position.

I divided the original image into pieces depending on the amount of rows & columns I'd wanted to give the puzzle - that is amount of puzzle pieces horizontal and vertical - and stored each puzzle piece in a 2D TextureRegion[][] array.

Then tried to make a copy of this array, so that I could shuffle up the pieces of the original array and then compare them to check whether my puzzle pieces matched the original array (hence the puzzle would be solved).

Trying to do this I ran into two issues:
(*I have 2 2D-TexureRegion Arrays: puzzlePiecesInArray & puzzlePiecesInArrayCopy)

1. Copy an arrays content can't be done with a simple statement like:

  1.    puzzlePiecesInArrayCopy = puzzlePiecesInArray;

After I added all the puzzle pieces to my puzzlePiecesInArray this is what I tried to do, but now both pointers (array names) actually point to the same array and comparing puzzlePiecesInArrayCopy to puzzlePiecesInArray would always return true as a result.

Thus in order to create 2 identical arrays i used a for loop to get the content of each array index and store it in the array 's copy like this:
  1. for (int j = 0; j < row; j++) {
  2.         for (int i = 0; i < col; i++) {
  3.         puzzlePiecesInArrayCopy[i][j] = puzzlePiecesInArray[i][j];
  4.         }
  5. }
(later i found out I could have also done it by using Arrays.copyOf)

2. Comparing two arrays like:

  1. if (puzzlePiecesInArray == puzzlePiecesInArrayCopy) {
  2.       // puzzle is solved code here
  3.    }

doesn't work.

But i could compare individual array indexes like:

  1. if (puzzlePiecesInArray[1][2] == puzzlePiecesInArrayCopy[1][2]) {
  2.            // do something
  3.    }

But now i had to figure out a way of how to compare all the indexes AND check if ALL results would be true AND only then run the code for the puzzle being solved.

Comparing all the indexes could easily be done with a for loop, but then somehow I had to think of a way to keep track of all the result so that at the end I could check if all results where true (this is puzzle is solved!).

I look around on the web to see if I could find a way to do this more easily and i found that java has a class called Arrays that has a method "equals" that is able to check if the content of arrays are the same.
This actually didn't work, but there was another method .deepEquals(array1,array2) and this actually does the trick.

So now i could do my array comparison with a simple line of code:

  1. if (Arrays.deepEquals(puzzlePiecesInArray, puzzlePiecesInArrayCopy)){
  2.          // puzzle solved!
  3.      }


zondag 26 oktober 2014

First app in the Store: Manbow Jr. - free "early release" version

While Manbow is occupied with destroying Kliever's home planet Manbow's son Jr. is occupied with something completely different?
"Is it a bird? Is it a plane?". No! It's Mam Bow Jr.!!

Mambow Jr. is a "teaser" game to the Norakomi's soon to be released Mambow2.
Based on one of our old time favourites, but spiced with the graphics and music of Mambow2, Mambow Jr. requires some serious skill to complete all 7* levels with our trademark 6 button on-screen movement controller. (don't say we didnt warn you)

Eat or be eaten!
Try to eat everything before THEY will get you.
Do you have the skill?

donderdag 2 oktober 2014

Development Log: Deva Prologue

The Project based on MSX' Goonies has been baptised "Deva Prologue" and gonna be a prequel to Norakomi's yet unfinished MSX game Deva that has been in development for quit a while now.

Currently graphics are being reworked by Robert Vroemisse who also created the Graphics for Deva.
And Deva's soundtrack composed by John Hassink will be re-used in Deva Prologue.

The Deva Prologue Title Screen + Soundtrack:

Deva MSX project demonstration:

woensdag 27 augustus 2014

Manbow2 Endboss level 3 almost done...

Boss for level 3 is as good as done.
Multiple scrolling layers; a fade out of part of the map and a fade in for a new background; 
The snakeballs spawn randomly.

I still have to finetune some stuff like different scrolling speeds, enemy health, spawn-"speed" of snakeballs & a killanimation + transition to next screen when you kill the enemy.
This is what it looks like now:

zondag 24 augustus 2014

Latest on Manbow2 port

My main focus for now is getting the Manbow2 port done.
I feel like it shouldn't take too long anymore untill we get it finished (a couple of weeks max), but somehow everything takes a bit more time then expected.

So what's the plan:
The plan is to get levels 1,3 & 9 from the original game recoded in java, create a graphic user interface for touch devices so it can be played on your phone and tablet & then get a downloadable beta version so it can be played, tested & so we can hopefully get some feedback.

The maps (background image) for all the levels are done.
Level 1 now has a background animation for the pre-cave part as well as randomized astroid debris flying in from the back that needs to be evaded.

Furthermore: enemies are now spawning powerup pods which can be taken to increase speed, strength of the ship's weapons, add missiles and options to your arsenal and change projectile types.
Weapon system is not fully finished yet, but basics have been made.
I also added a splashscreen with the norakomi logo & a simple menuscreen.

The screenrecording has been improved slightly.

Here's another peak into level1:
(Next videoshot will be from a different level...)

So the next important steps:
- add enemies for level 9
- add end-boss for levels 1,3 & 9
- create GUI for touch devices
- create a settings screen 

New logo!

We got a new logo!
Thanks to Robert Vroemisse who's working with my brother on our Platform Game based on The Goonies and on Deva for the MSX.