0
\$\begingroup\$

I am working on an Android game scenario inspired by Moon Patrol.

My beta version is available for beta test from https://play.google.com/store/apps/details?id=dev.android.buggy

In my case, I got the elapsed time in seconds for reaching a checkpoint, and I could reward either a fixed bonus or a bonus based on the time, perhaps the difference between the time and the average time, or another bonus if it is a high score. My specific implementation for completing a checkpoint looks as follows at the moment:

enter image description here

if (checkpointComplete) {
    ((Activity) this.getContext()).runOnUiThread(new Runnable() {
        @Override
        public void run() {
            //
        }
    });
    canvas.drawColor(Color.BLACK);
    ((ParallaxActivity) getContext()).stopWatch.stop();
    paint.setTextSize(60);
    String s2 = "TIME TO REACH POINT \"" + Background.checkpoint + "\"\n";
    if (runOnce) {
        for (int q = 0; q < s2.length(); q++) {
            final String s2f = s2;
            final int r = q;
            ((Activity) this.getContext()).runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    checkpointtextview.setTextColor(Color.RED);
                    checkpointtextview.append(Character.toString(s2f.charAt(r)));
                }
            });
            try {
                Thread.sleep(50);
            } catch (InterruptedException ie) {
            }
        }
    }
    String str = String.format("%03d", ((ParallaxActivity) this.getContext()).countUp);
    String s3 = "YOUR TIME                :   " + str;
    if (runOnce) {
        for (int q = 0; q < s3.length(); q++) {
            final String s3f = s3;
            final int r = q;
            ((Activity) this.getContext()).runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    checkpointtextview2.setTextColor(Color.parseColor("#ADD8E6"));
                    checkpointtextview2.append(Character.toString(s3f.charAt(r)));

                }
            });
            try {
                Thread.sleep(50);
            } catch (InterruptedException ie) {
            }
        }
    }
    runOnce = false;
    // canvas.drawText("CHECKPOINT COMPLETE", (float) (screenWidth * 0.35), (float) (screenHeight * 0.45), paint);
    ((Activity) this.getContext()).runOnUiThread(new Runnable() {
        @Override
        public void run() {
            Handler handler = new Handler();
            handler.postDelayed(new Runnable() {
                @Override
                public void run() {
                    ((ParallaxActivity) getContext()).startTime = SystemClock.elapsedRealtime();
                    ((ParallaxActivity) getContext()).stopWatch.setBase(((ParallaxActivity) getContext()).startTime);
                    ((ParallaxActivity) getContext()).stopWatch.start();
                    checkpointtextview.setText("");
                    checkpointtextview2.setText("");
                    checkpointtextview3.setText("");
                    checkpointtextview4.setText("");
                    checkpointtextview5.setText("");
                    checkpointtextview6.setText("");
                    String str = "Player 1  " + String.format("%06d", score);
                    tvId.setText(str);
                    scoring = false;
                    buggyXDistance = 0;
                    distanceDelta = 0;
                    retardation = 0;
                    checkpointComplete = false;
                    runOnce = true;

                }
            }, 3000);
        }
    });
}

I want to calculate bonus for completing a checkpoint but how is it calculated? If we look at the original it looks like below.

enter image description here

enter image description here

Is it possible to deduce the formula for calculating the bonus? My bonus screen looks the same. So if your time is x and the average time is y and the record is z, what is the formula?

\$\endgroup\$
  • 2
    \$\begingroup\$ I'm voting to close this question as off-topic because this is not a question about game development but a question about how a specific game implements its score system. \$\endgroup\$ – Charanor Jun 23 '18 at 3:41
  • \$\begingroup\$ @Charanor What do you mean? The question is absolutely about game development. Read what you wrote yourself: "Implementing a score system" \$\endgroup\$ – Niklas Rosencrantz Jun 23 '18 at 3:52
  • \$\begingroup\$ Not all games have the same score system. One game might have best - time/average and another might have log(best) * average - min or literally any other formula. What this question does is ask how the game in your picture implements their score system. If I have misunderstood and you're asking about a general score system it would help if you rephrased your question and address 1) Exactly what you need help with 2) What you have tried 3) Why it didn't work (what happened and was the expected result?). \$\endgroup\$ – Charanor Jun 23 '18 at 4:21
  • \$\begingroup\$ @Charanor I am being specific about a specific scoring system. Do you have a problem with that? \$\endgroup\$ – Niklas Rosencrantz Jun 23 '18 at 5:27
  • 1
    \$\begingroup\$ That's still a detail of a specific game. \$\endgroup\$ – Tyyppi_77 Jun 23 '18 at 18:58
1
\$\begingroup\$

The formula is available at this link:

COURSE ONE                                POINTS
Completing each section of five markers     1000
Each second under 55 seconds it takes        100
to complete section 1 or 2
Each second under 60 seconds it takes        100
to complete section 3 or 4
Each second under 65 seconds it takes        100
to complete section 5
Completing the entire first course          5000
\$\endgroup\$

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.