Kill them all game, Android SDK, Java, Eclipse

Here is an Android game I built after watching a series of tutorials, which you can find here

There tutorials are by edu4java
Here is her channel.

I am currently adding more functionality to this game such as splash screen, HUD, High Score Board ect..

This is built in the Eclipse IDE, using the Java and the Eclipse Emulator.


6 thoughts on “Kill them all game, Android SDK, Java, Eclipse

  • July 17, 2017 at 8:33 pm

    package com.example.killthemall;
    import java.util.ArrayList;
    import java.util.List;
    import android.content.Context;
    import android.view.Gravity;
    import android.view.MotionEvent;
    import android.view.SurfaceHolder;
    import android.view.SurfaceHolder.Callback;
    import android.view.SurfaceView;
    import android.widget.Toast;

    //local variables
    public class GameView extends SurfaceView
        private int  time = 0;
        private long startTime = System.currentTimeMillis();
    // Each state should have a function
    // I will not be posting all of the code
        private static final int INITAL = 0;
        private static final int SPLASH = 1;
        private static final int RUN = 2;
        private static final int SCORE = 3;

    //helper function to get time that has passed
    private void getTickCount(long StartTime)
    // subtract the StartTime from the current time
            long currentMillisec = System.currentTimeMillis() – StartTime;
            int temp = (int)(-currentMillisec / 1000);
            time = (int) (currentMillisec / 1000);
            //De-increment score per second and create the total score
            score = temp + bad + good + 100;


        protected void onDraw(Canvas canvas)
          if (gameState == RUN)
                //Start the timer and score
                //Create the paint for the score
                Paint paintS = new Paint();
                //create the HUD
                Bitmap bmpHUD = BitmapFactory.decodeResource(getResources(), R.drawable.hud);
                canvas.drawBitmap(bmpHUD, 20, 10, null);
                //Draw the score
                canvas.drawText(String.valueOf(score), 80, 26, paintS);
                canvas.drawText(String.valueOf(time), 250, 26, paintS);

                //Draw blood
                for (int i = temps.size() – 1; i >= 0; i–)
                //Draw sprites
                for (Sprite sprite : sprites)

    if (gameState ==  SCORE)
                if (state3)
                    state3 = false;
                //Create the paint for the score
                Paint paintHS = new Paint();
                Bitmap background = BitmapFactory.decodeResource(getResources(), R.drawable.score);
                canvas.drawBitmap(background, 10, 10, null);
                //I did not complete this part but
               // all you would have to do is change the values to variables
              // which would be loaded in from some sort of file.
            // look into saving and loading files

                //Score 1
                canvas.drawText("JNL", 95, 70, paintHS);
                canvas.drawText(String.valueOf(score), 185, 70, paintHS);
                //Score 2
                canvas.drawText("JNL", 95, 125, paintHS);
                canvas.drawText(String.valueOf(66), 185, 125, paintHS);
                //Score 3
                canvas.drawText("KML", 95, 182, paintHS);
                canvas.drawText(String.valueOf(53), 185, 182, paintHS);
                //Score 4
                canvas.drawText("JML", 95, 240, paintHS);
                canvas.drawText(String.valueOf(33), 185, 240, paintHS);
                //Score 5
                canvas.drawText("EZ", 95, 298, paintHS);
                canvas.drawText(String.valueOf(28), 185, 298, paintHS);
                //Score 6
                canvas.drawText("NIK", 95, 356, paintHS);
                canvas.drawText(String.valueOf(19), 185, 356, paintHS);

  • July 17, 2017 at 8:33 pm

    Is it possible to get the code for the score, play and timer today. Would be greatly appreciated as I am doing this for a project and after days of trying to figure it out I am out of time. Thanks Have a great summer.

  • July 17, 2017 at 8:33 pm

    hey can you give me the source code it will be very much helpful for me

  • July 17, 2017 at 8:33 pm

    Hey can you teach me how to do the timer, score and high score stuff??please…thank you


Leave a Reply

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