Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9178701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:36:55+00:00 2026-06-17T17:36:55+00:00

ok heres the problem im have i have made a fully working game, with

  • 0

ok heres the problem im have i have made a fully working game, with menu and help page score lives levels, but i can’t get the timer working as it should, at 1st i thought it was an if() but i ran it it would go down to fast.

i have made the game in using android java (eclipse), i would post some code up but im not sure which bits you would like to see, i now that secs in java are milisecs so 50000/1000 = 50secs but i dont know how to do it, i looked a few exmaple code and im not sure how it is working.

the timer is a label i made that appear on the AVD, atm it just says 50000 and not doing anything

i tried doing it this way

public class timer extends CountDownTimer{

        public timer(long timer, long Interval) {

            super(timer, Interval);
            // TODO Auto-generated constructor stub
        }

        @Override
        public void onFinish() {
            // TODO Auto-generated method stub
            //canvas.drawText("GAME OVER", 200, 700, paint);

        }

        @Override
        public void onTick(long millisUntilFinished) {
            // TODO Auto-generated method stub

            realtime = (int) millisUntilFinished;

        }

    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T17:36:56+00:00Added an answer on June 17, 2026 at 5:36 pm

    When the game starts save the system time and create a new Paint instance with the text size and color you want.

        startTime = System.currentTimeMillis();
        text = new Paint();
        text.setColor(Color.RED);
        text.setTextSize(20);
    

    To draw the text onto the canvas / screen inside your onDrow method do something like this.

        timeNow = System.currentTimeMillis();
        long timeToGo = 50 - (timeNow - startTime) / 1000;
        if (timeToGo >= 0) {
            canvas.drawText(Long.toString(timeToGo), 10, 25, text);
        }
    

    This will place a red count down timer in the top left of your screen that counts down from 50.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Probably something simple, but heres my problem, I have implememnted a simple captcha into
i have made a toolbar using links placed inside listitems but the problem is
Here's my problem: I have an unmanaged dll that I made.I'm calling one of
So we have this problem that we are trying to figure out. Heres what
Here's my problem: I have do create a menu/list of actions (which would be
I made an application and a dll, which are working this way: I have
I have a problem with a slideshow I'm working on, using the jQueryCycle script.
I have made a website in ASP.NET 3.5 With C#.In the default page we
I have a problem. I made a simple search engine which searches by brand
I've made an example project to show my problem. It can be downloaded in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.