Saturday, October 4, 2014

Facebook SDK for android!

So I tried to see if I could get a hang of the facebook sdk. When it implements into our game we would have to make platform specific code, that means, different code for desktop, iOS, android. More about that can be found here.

I have successfully created an facebook app, and gotten my development hash to work with the samples that I messed around with. It took a lot of time to find out the problem behind this, but it would seem that facebook uses a security measure to know that your app is indeed authenticated to your facebook app. On mac you can create this hash by typing

keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64 

into the terminal. This will prompt a password, which you type in. It is then encrypted and generated through openSSL, sha1, base64 or whatnot into a hash, if you want to recreate the hash you will need the same computer and the same password.

Now I got some FB SDK sample code to work for pure android code, the problem is when we're going to do it in libGDX. I think that the best approach would be to write an interface for the desktop environment, as seen in the link above, do the android native as seen in various FB to android tutorials, and then use the Blue River Interactive roboVM bindings for iOS. This puts a lot of more work then I previously though into implementing the game into facebook, as we really chose libGDX because we wanted to avoid writing platform specific code. But this seems like the only legitimate solution here, additionally it is valuable knowledge and experience to learn to code native android and to learn bindings for the robo virtual machine.

The highscore will probably be implemented with the platform specific code, but I believe that I will start by implementing a local highscore feature with Json. Or perhaps not, we'll see.


Friday, October 3, 2014

GETTING MONEY! AdMob and GPS implementation in android

Today Steven tried to use the Nuggetta framework to make cross-compiling work between iOS and Android SDKs. It would be ideal as we would just need to implement their facebook integration code directly into our core project. However it seemed like libGDX was not updated, their APIs and skeleton tutorials was linked to the old roboVM build of libGDX iOS. Which basically means that you have to do a lot of things manually anyway since you need to rewrite the parts that they haven't implemented yet. Something that Steven tried to put some time into, however quickly gave up as the documentation was lacking and it seemed like such a small community that there was no point in asking for help.

So instead Steven looked into what Axel did tried with BRI, something that turned out to be quite a hastle. I have not yet started on any iOS bindings, but I got adMob to work with android and succedded in implementing an ad on the top of the screen, using

import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;

import android.widget.RelativeLayout.LayoutParams;
import com.google.android.gms.ads.AdView;

All these nice libraries. The thing with ads is, you need to create different views, layers if you will. That is our RelativeLayout, we then create an adView (adView) and a gameView (View), these are added to our RelativeLayout and with a little of behind the scenes magic, we have two different views, one showing our ad, and one displaying our gameView.

The views are not layered by when they are added into the layout, it is not like a stack or a list. But by setting an ID to the view 

adView.setId(12345);

You can determine which view will be on top. I think higher IDs are on top!

So I do not even know if we are going to have ads in our game, but it is nice to know that just simple android code works in libgdx and that it is implementable. Now we just need to figure out how to change the state of the android application from within our core project code. (Notice: Just needs to...)



Here is a screenshot of what I got working, notice the ad at the top!

I also tried to click on the ad, and it worked!


Menu icons


All the menu icons are now almost done. We’ve decided on a graphical style were we keep the origami theme in the buttons too. Yet, we focused on making them simple and not too complex since that would make the icons more difficult to understand.

There is some work left to do, which is deciding on the background colors for each button and deciding if we should go for completely flat design or add a small depth. For now we decided to have some depth on the button itself and make the ”paper icon” flat. This is how (some of them) they look now:


Animation and CLOUDS


We did some progress in the animation part. There are still a lot of things that has to be changed in the power up animation like the colors, size and the angles on the triangles, but the image still shows the direction we are going for(Super Saiyan from Dragonball Z). Other than that Christian created a cloud for the landing.

The idea is that the clouds will appear when the frog lands on the ground and float in opposite direction. While floating in each direction the opacity will be reduced to make them disappear. 

We also considered changing the water. As it is now the water consists of squares and maybe it would fit the game more to change it to triangles. 

Thursday, October 2, 2014

Stevens wednesday 1/10

So a lot of clean up was made in the code, Steven removed some classes that wasn't needed and implemented the little stuff that was needed into the classes which used them directly.

Futhermore a main menu screen has been added with the only functionality of clicking the play button to enter a new game. There are some bugs with pressing the and it seems like sometimes the click does not register. There has to be done some debugging on this part to check out the reason. Futhermore in the end we want the main menu to be more alive, with animations in the background and have the buttons animation onClick().

Score has been added into the game, a font has been added aswell but it seems like there are some problems with the BitMapFonts, Steven don't know why, since basically the implementation as it is now are just a copy/paste from our flappy birds tutorial project. The files are exactly the same, again there has to be done some more extensive debugging here to figure out the reason.

We are now mostly done with the architecture and are starting to really add game mechanism and Steven even played around a little with the game dynamics as he tried to implement some differences in how the frog jumps, as the jump has to be made quicker to succeed with the highest fishes. There are however some stuff that needs to be implemented into the architecture that we haven't yet looked at, for example the music and sound, any network code, and of course the solution to connect to Facebook either through facebook SDK with RoboVM, or going through Nuggetta which seems like a very good contender, and will probably be easier to get started.

New graphics are starting to get implemented as well as figuring out different mechanics and how they should be implemented. It was really nice to finally have the fish height jump bug out of the way, as looking at your own code for hours on straight can make you see double.

All about the fishes

Fixed fish jump calculation. The problem was we gave Java’s Math.sin() function an angle in degrees, when it wanted it in radians.
Then Axel switched our placeholder fish image to the fish texture that Andreas made and also changed the hitboxes of the fish from just one big rectangle to two smaller ones. This might not be enough for hitboxes though, we might need to revisit this in the future.
Frog and fish with hitboxes in red.

Wednesday, October 1, 2014

updated background image

We did some updates on the background image like adding mountains and spruces. The final image won't be as saturated as it is now because it's to much "in your face" right now.

Below you can see where we took inspiration from:
We saw that there is a forest before where the mountain starts as well as a shore with stones. We will add it in a later iteration. Maybe we will even add a reflection on the water.