Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#Actualslicer4ever

Posted 09 February 2013 - 08:37 PM


why are you calling run after you setIsRunning(true)?(now your in a loop inside the input function)

 

if that's not the problem, idk because you barely posted any real code.

 

what we need to see is:

 

Initialization code

--Main game loop(is this controlled by "isRunning", because if so, setting it to false should break the loop.)

---Where you check for input(is this inside your main loop, which is controlled by the "isRunning" flag?)

because my approach was to pause the game. The only way to do it is to break out of the gameLoop. If I unpause the game, I need to call the run method which execute the game loop to keep things drawing again. the run method needs to be called by the programmer. the key events are in the keyPressed method of the Game class since the Game class will be responsible for controlling the pause/unpause nature of the game.

 

Are you sure you saw my code? blink.png

think about what it means to start an infinite loop inside your input logic thread.  and as far as i can see, that infinite loop does not check your input.

 

so yes, we need to see more code(unless my above assumption is correct, and that is why you can only pause/unpause once)

 

insead of doing:

 

 

void run(void){
  while(isRunning){
  }
}

 

try:

 

 

void run(void){
 while(!isDone){
  if(isRunning){
   //game logic here
  }
}

#5slicer4ever

Posted 09 February 2013 - 08:37 PM


why are you calling run after you setIsRunning(true)?(now your in a loop inside the input function)

 

if that's not the problem, idk because you barely posted any real code.

 

what we need to see is:

 

Initialization code

--Main game loop(is this controlled by "isRunning", because if so, setting it to false should break the loop.)

---Where you check for input(is this inside your main loop, which is controlled by the "isRunning" flag?)

because my approach was to pause the game. The only way to do it is to break out of the gameLoop. If I unpause the game, I need to call the run method which execute the game loop to keep things drawing again. the run method needs to be called by the programmer. the key events are in the keyPressed method of the Game class since the Game class will be responsible for controlling the pause/unpause nature of the game.

 

Are you sure you saw my code? blink.png

think about what it means to start an infinite loop inside your input
logic thread.  and as far as i can see, that infinite loop does not check your input.

 

so yes, we need to see more code(unless my above assumption is correct, and that is why you can only pause/unpause once)

 

insead of doing:

 

void run(void){
  while(isRunning){
  }
}

 

try:

 

void run(void){
 while(!isDone){
  if(isRunning){
   //game logic here
  }
}

#4slicer4ever

Posted 09 February 2013 - 08:34 PM


why are you calling run after you setIsRunning(true)?(now your in a loop inside the input function)

 

if that's not the problem, idk because you barely posted any real code.

 

what we need to see is:

 

Initialization code

--Main game loop(is this controlled by "isRunning", because if so, setting it to false should break the loop.)

---Where you check for input(is this inside your main loop, which is controlled by the "isRunning" flag?)

because my approach was to pause the game. The only way to do it is to break out of the gameLoop. If I unpause the game, I need to call the run method which execute the game loop to keep things drawing again. the run method needs to be called by the programmer. the key events are in the keyPressed method of the Game class since the Game class will be responsible for controlling the pause/unpause nature of the game.

 

Are you sure you saw my code? blink.png

think about what it means to start an infinite loop inside your input logic thread.  and as far as i can see, that infinite loop does not check your input.

 

so yes, we need to see more code(unless my above assumption is correct, and that is why you can only pause/unpause once)


#3slicer4ever

Posted 09 February 2013 - 08:34 PM


why are you calling run after you setIsRunning(true)?(now your in a loop inside the input function)

 

if that's not the problem, idk because you barely posted any real code.

 

what we need to see is:

 

Initialization code

--Main game loop(is this controlled by "isRunning", because if so, setting it to false should break the loop.)

---Where you check for input(is this inside your main loop, which is controlled by the "isRunning" flag?)

because my approach was to pause the game. The only way to do it is to break out of the gameLoop. If I unpause the game, I need to call the run method which execute the game loop to keep things drawing again. the run method needs to be called by the programmer. the key events are in the keyPressed method of the Game class since the Game class will be responsible for controlling the pause/unpause nature of the game.

 

Are you sure you saw my code? blink.png

think about what it means to start an infinite loop inside your input logic thread.  and as far as i can see, that infinite loop does not check your input.

 

so yes, we need to see more code(unless my above assumption is correct)


#2slicer4ever

Posted 09 February 2013 - 08:34 PM


why are you calling run after you setIsRunning(true)?(now your in a loop inside the input function)

 

if that's not the problem, idk because you barely posted any real code.

 

what we need to see is:

 

Initialization code

--Main game loop(is this controlled by "isRunning", because if so, setting it to false should break the loop.)

---Where you check for input(is this inside your main loop, which is controlled by the "isRunning" flag?)

because my approach was to pause the game. The only way to do it is to break out of the gameLoop. If I unpause the game, I need to call the run method which execute the game loop to keep things drawing again. the run method needs to be called by the programmer. the key events are in the keyPressed method of the Game class since the Game class will be responsible for controlling the pause/unpause nature of the game.

 

Are you sure you saw my code? blink.png

thank about what it means to start an infinite loop inside your input logic thread.  and as far as i can see, that infinite loop does not check your input.

 

so yes, we need to see more code(unless my above assumption is correct)


#1slicer4ever

Posted 09 February 2013 - 08:33 PM


why are you calling run after you setIsRunning(true)?(now your in a loop inside the input function)

 

if that's not the problem, idk because you barely posted any real code.

 

what we need to see is:

 

Initialization code

--Main game loop(is this controlled by "isRunning", because if so, setting it to false should break the loop.)

---Where you check for input(is this inside your main loop, which is controlled by the "isRunning" flag?)

because my approach was to pause the game. The only way to do it is to break out of the gameLoop. If I unpause the game, I need to call the run method which execute the game loop to keep things drawing again. the run method needs to be called by the programmer. the key events are in the keyPressed method of the Game class since the Game class will be responsible for controlling the pause/unpause nature of the game.

 

Are you sure you saw my code? blink.png

thank about what it means to start an infinite loop inside your input logic thread.  and as far as i can see, that infinite loop does not check your input.

 

so yes, we need to see more code(unless my above assumption is correct)


PARTNERS