Results 1 to 1 of 1
Thread: Constantly "Awake" program
- 02-17-2013, 05:55 PM #1
Member
- Join Date
- Jan 2013
- Posts
- 5
- Rep Power
- 0
Constantly "Awake" program
Hello,
I am trying to make a 2D map. The map consists of many tiles of different colors (white for ground, green for trees, etc.) I want to know how to make it keep animating without stop AND have a certain tile move by actionlistener of the keyboard simultaneously. (In other words, tiles are moving randomly, and whenever you click to move, a specific tile moves in the directly you indicated. I want the movement of the tiles and the movement of the user tile to be independent. So far I have this, but If I make a user movement, the tile I moved "waits" till the repaint() occurs.
Any advice? Thanks in advance.Java Code:for(double i=0; true; i ++) { try { Thread.sleep(100); } catch (InterruptedException e) {} .... repaint(); }Last edited by CORNandTOOTHPICK; 02-17-2013 at 06:02 PM.
Similar Threads
-
access denied("java.net.SocketPermission" "127.0.0.1:1099" "connect,resolve")
By klspepper in forum New To JavaReplies: 0Last Post: 12-07-2012, 08:29 AM -
Convert string operation symbols "+", "-", "/", "*" etc.
By Googol in forum New To JavaReplies: 3Last Post: 10-30-2012, 03:06 PM -
Program skips "If" code and goes straight to "Else"
By Logik22 in forum New To JavaReplies: 12Last Post: 01-21-2012, 05:40 PM -
the dollar sign "$", prints like any other normal char in java like "a" or "*" ?
By lse123 in forum New To JavaReplies: 1Last Post: 10-20-2008, 07:35 AM -
"Jumble" or "Scramble" Program
By Shadow22202 in forum Java AppletsReplies: 8Last Post: 04-30-2008, 03:42 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks