Popular questions for this item

How Can I make the interstitial ad appear less often?

To make the interstitial ad appear once every 4 game overs for example you need to add this to your code:

Open Maingame.java

Go to Line 610:

    public synchronized void GameOver() {
        openAd();
        StopMusic();
        state = GAMEOVER;
        highscoreManager.AddName_Editview(((int) (ScreenWidth() / 1.5f) < dpToPx(250)) ? ((int) (ScreenWidth() / 1.5f)) : (dpToPx(250)), getResources().getString(R.string.Highscore_hint), (int) (ScreenHeight() * 0.68f));
    }
Change those 6 lines to this:
        int counter = 0;
    public synchronized void GameOver() {

                if(counter>3){
                openAd();
                    counter=0;
                 }
                  counter++;
           StopMusic();
           state = GAMEOVER;
           highscoreManager.AddName_Editview(((int) (ScreenWidth() / 1.5f) < dpToPx(250)) ? ((int) (ScreenWidth() / 1.5f)) : (dpToPx(250)), getResources().getString(R.string.Highscore_hint), (int) (ScreenHeight() * 0.68f));

    }

How can I make the background a gradient?

Open maingame.java and go to line 719:

//Rendering of background
    public void renderBackground(Canvas canvas) {

        //TODO: you may wish to change background colors from here
        canvas.drawColor(Color.rgb(153, 204, 255));

        background_shader.setARGB(255, 205, 229, 240);
        int radius = DrawBackgroundCloud(canvas, (int) (ScreenHeight() / 2.5), 10);
        canvas.drawRect(0, (float) ((ScreenHeight() / 2.8) + radius * 1.5), ScreenWidth(), ScreenHeight(), background_shader);

        background_shader.setARGB(255, 108, 181, 213);
        radius = DrawBackgroundCloud(canvas, (int) (ScreenHeight() / 1.7), 7);
        canvas.drawRect(0, (float) ((ScreenHeight() / 2.3) + radius * 1.5), ScreenWidth(), ScreenHeight(), background_shader);

    }
change this function to:
//Rendering of background
    public void renderBackground(Canvas canvas) {

        //TODO: you may wish to change background colors from here
        //canvas.drawColor(Color.rgb(153, 204, 255));
        Paint background_paint = new Paint();
        background_paint.setShader(new LinearGradient(ScreenWidth() / 2, 0, ScreenWidth() / 2, ScreenHeight(), Color.argb(255, 173, 230, 255), Color.argb(255, 70, 151, 250), Shader.TileMode.CLAMP));
        canvas.drawRect(0, 0, ScreenWidth(), ScreenHeight(), background_paint);

        background_shader.setARGB(255, 205, 229, 240);
        int radius = DrawBackgroundCloud(canvas, (int) (ScreenHeight() / 2.5), 10);
        canvas.drawRect(0, (float) ((ScreenHeight() / 2.8) + radius * 1.5), ScreenWidth(), ScreenHeight(), background_shader);

        background_shader.setARGB(255, 108, 181, 213);
        radius = DrawBackgroundCloud(canvas, (int) (ScreenHeight() / 1.7), 7);
        canvas.drawRect(0, (float) ((ScreenHeight() / 2.3) + radius * 1.5), ScreenWidth(), ScreenHeight(), background_shader);

    }
You might receive an error with the shader. If so this is because it hasn’t been imported yet so just go ahead and add the following with the class imports in the top (line 33).
import android.graphics.Shader;

There seems to be a bug between column 7 and 8. How can I fix it?

Hi, That can be done from maingame.java line 109:
    final float column_positions[][] = new float[][] {
            //{X coordinate of column, Y Coordinate of hole, where 0.5f is center of screen}
            { 600, 0.5f },//first column
            { 900, 0.3f },//second column
            { 1200, 0.2f },
            { 1500, 0.3f },
            { 1800, 0.1f },
            { 2100, 0.4f },
            { 2400, 0.5f },//7th column
            { 2600, 0.8f },//8th column
            { 2800, 0.2f },//9th column
            { 3100, 0.1f },
            { 3400, 0.4f },
            { 3700, 0.5f },
            { 4000, 0.4f },
            { 4300, 0.3f },
            { 4600, 0.1f },
            { 4900, 0.3f },
            { 5200, 0.8f },
            { 5500, 0.4f },
            { 5700, 0.5f },
            { 6000, 0.1f },
            { 6300, 0.4f },
            { 6700, 0.1f },
            { 7100, 0.6f },
            { 7300, 0.4f },
            { 7500, 0.6f },
            { 7800, 0.8f },
            { 8100, 0.1f },
            { 8400, 0.9f },
            { 8700, 0.5f },
            { 8900, 0.6f },
            { 9300, 0.2f },
            { 9600, 0.6f },
            { 9900, 0.8f },
            { 10200, 0.1f },
            { 10500, 0.9f },
            { 10800, 0.2f }
    };
just increase/decrease the large numbers (X-coordinate) to move columns. example to separate further column 7,8 and 9 change:
{ 2400, 0.5f },//7th column
{ 2600, 0.8f },//8th column
{ 2800, 0.2f },//9th column
to:
{ 2400, 0.5f },//7th column
{ 2800, 0.8f },//8th column
{ 3200, 0.2f },//9th column
Then just also increase the x coordinate of the preceding columns

How can I ad banner ad to App?

If you wish to add a banner you can add it to screen.java line 69. There is : layout = new RelativeLayout(this);

Just add the banner and ad request to the layout like:

AdView ad = new AdView(this, AdSize.BANNER, <your id here>); //make sure id is of banner ad.
//layout
RelativeLayout.LayoutParams params1 = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
ad.setLayoutParams(params1);
layout.addView(ad);
AdRequest request = new AdRequest();
ad.loadAd(request);

The code would immediately get highlighted red with errors. This is because you need to import the respective libraries. If you right click on each highlighted element eclipse might offer solutions for you. Else import:

import android.widget.RelativeLayout.LayoutParams;
import com.google.ads.AdRequest;
import com.google.ads.AdSize;
import com.google.ads.AdView;

Then if you wish you can remove the interstitial ads by removing maingame.java line 107:

// Begin loading your interstitial
interstitial.loadAd(adRequest);

Show more

by
by
by
by
by
by