thanks mate :)
Type: Posts; User: viper_07
thanks mate :)
haha yeah thankyou so much for helping me with this :) i am most greatfull
found the problem
for (int i=0; i<opc;i++){
insted of
for (int i=0; i<=opc;i++){
now the balls are moving the same way at the same speed
one ball is moving strange too as the print out shows it seems to be on the x axis, i saw post #30 yeah i am going to chenge the window size now
thats just for one ball
here is a print out of the posision
x = 758 y = 547
x = 50 y = 524
x = 757 y = 548
x = 49 y = 525
x = 756 y = 549
x = 48 y = 526
x = 755 y = 550
x = 47 y = 527
it must be something to do with the for loop because all varibles are the same with and without it and when i put a break; after the while the balls work perfectley hmmmm this is deffonatley a...
it seems that the ball is containd on one side of the page the balls see as tho they are not flowing more like traped on one side
yeah that was careless of me to have put that there so now only the threads i need are created, but i still can't get to grips with why the out put is
messed when the for loop is in place
yes that is abit strange, but how can that happen it must be because when
public RunnableThread(String s)
{
ball = new Thread(this,s);
//ball.start();
i am starting the ball here when i...
no the run method should only be run once as it should continue to run
1 thread per ball should be created
i get
X:\Desktop\Programing Resit#\tests\bb2\test 2\test3>javac *.java
...
this is the print outs i got:
X:\Desktop\Programing Resit#\tests\bb2\test 2\test3>javac *.java
X:\Desktop\Programing Resit#\tests\bb2\test 2\test3>java Bouncing_Ball
run for thread1
run for...
yes apart from when the new ball is added it is as tho it never go created
a new runnable thread is created when the user clickes
the run method is called when a thread starts
i found that it runs thread1 then Thread - 3 which i presume is the sleep time it dose that 4...
that without the for loop
here is what i got:
start while dx-1
start while dy-1
start while dx-1
start while dy-1
start while dx-1
start while dy-1
start while dx-1
start while dy-1
array line No in array collum
ovl [0] [0] = X cordinates
ovl [1] ...
yeah i had a look through the logic the for loop breaks the while as each thread needs to be running in the while at all times, the for loop runs through 1 2 3 individualy shutting off the other...
[Java] import java.awt.*; import java.awt.event.*; import javax.swing.*; import java - Pastebin.com
its a gui interface i pasted the section of the code, would you like me to paste bin the whole program so you can see what is going on properly
also there is no compile errors
hi i have a slight problem with my code, i am looking to update all posisions in an array for example
private int [] [] ovl = new int [maxovl][4];
ovl [0] [0]+=dx;
ovl [0] [1]+=dy;
...