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 8040587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:56:50+00:00 2026-06-05T03:56:50+00:00

I have the following code: CCProgressTimer *aTimer; -(void) generateDungeon { srand (time(NULL)); [self initDungeonArray];

  • 0

I have the following code:

CCProgressTimer *aTimer;


-(void) generateDungeon {

    srand (time(NULL));
    [self initDungeonArray];

    int numRooms = RNDM(10,100);
    for (int a=0; a< numRooms; a++) {
         [self makeRandomRoom];
         aTimer.percentage += 100/numRooms;
    }

[self connectTheRooms];
[self placeStairs];
}

The problem is that during the loop the timer does not get updated on screen, then suddenly (after the loop finishes I think) fills up to nearly full. I don’t understand why this is happening. I thought that when you change the percentage, the image would update.

Can anyone help me understand what I should be understanding?

Thanks.

  • 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-05T03:56:51+00:00Added an answer on June 5, 2026 at 3:56 am

    Your image(in this case, you progress timer), updates on the screen in draw() and visit() methods. They are called every tick. Here you change it’s value in one tick. So during previous drawing the timer value was 0 percent, and on the next drawing it’s value will be 100

    you make it in the single thread. so your timer will not be update in this case. to create updatable timer, you can try to move your long working code to the separate thread. then you will be able to update timer.

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

Sidebar

Related Questions

I have following code if (rs != null) { out.println(result set has got something);
I have following code for opening all files: int ret= open(zFile, flags, mode); posix_fadvise
I have following code in Java: import java.util.*; public class longest{ public static void
I have following code: private void fileSystemWatcher_Changed(object sender, System.IO.FileSystemEventArgs e) { System.Diagnostics.Process execute =
I have following code: canvas=new MembershipFunctionComponent(functions); canvas.setPreferredSize(new Dimension((int)this.getWidth(), (int)this.getHeight())); canvas.addMouseListener(canvas); pane.add(canvas); MembsershipFunctionComponent extends JComponent.
I have following code: typedef int (*t_Function) (int x); t_Function Functions[MAX_FUNCTIONS]; int f(int x)
I have following code snippet: self.xmlHttpReq = new XMLHttpRequest(); self.xmlHttpReq.onreadystatechange = function() { if(self.xmlHttpReq.readyState
I have following code snippet in c# List<int> list = new List<int>() { 1,
I have following code using loop unrolling: #pragma unroll for (int i=0;i<n;i++) { ....
I have following code to play small audio files private void playVoice() { if

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.