• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

pause untill player has clicked the image

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am devoloping online chess game. Now the problem is when pawn promotion takes place player has to select a promoted piece. The execution should pause until player has selected a new piece. I am sharing my code below where this part of the code checks if pawn promotion has taken place. If yes, then it asks player to select a piece (which is second part of the code). The execution should pause until a piece is selected:



Here is the inside of piece selection code:



In above the data must be set before the execution is resumed. This data depends upon the piece selected. So in other way execution should not resume until player has choosen a piece.

Please help me on this.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Web pages are event driven, so there's really no such thing as "pausing the execution".

If you want the pages to be in a different state while waiting for something specific to happen, you need to write the code accordingly. For example, if the user must perform a certain action before proceeding, you could disable the stuff that he or she cannot do until the required action is taken.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic