Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by jprog1000 Got it. Thank you so much! Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by vortex_1 In my opinion, implementing a feature in a bouncing balls simulation where a new ball is created when two balls collide can add an interesting and dynamic element to the simulation. This feature can introduce a sense of complexity and unpredictability, making the simulation more engaging and challenging for users. It could also provide an … Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by jprog1000 Great reply, vortex! Agree with all your points. Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by Digital_39 Hi, Its helpful for me. I got my answer. Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by jprog1000 … class. When I tried creating a new ball in the nested loop that checks for collision (used an array list), and then… Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by toneewa Some minor syntax fixes. Some things to consider are the collision and distance of drawing the next ball. A ball inside a ball's radius will cause numerous collisions. Even the starting ball locations can be already causing collisions. I added a collision counter display. Increased the maximum balls to make to 50. The timer delay can also impact … Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by jprog1000 Thank you so much for your reply and additions! It is certainly working as I wanted. I will read through the code you have added and ask you any questions I might have. I hope you don't mind. Regards Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by Dani I’ll mark this question solved :) Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by Dani … oh, sorry, missed the bit about you still needing clarifications. Feel feee to ask :) I’ll now unmark this topic as solved. /facepalm Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by toneewa I cleaned up the code some more. Removed some things that were not being used. I ran into a couple problems which caused the freeze you mentioned. It was memory heap space and array allocating. E.g., if x or y becomes negative, and also infinite recursion. I added a x/y coordinate display for a ball, and tinkered with the placement of the … Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by jprog1000 Hello, Thank you again so much! All your additions are clear, but it seems like whenever two balls collide, more than one ball is added to the arraylist and painted. Any way to have just one ball added to the panel for every collision? Have some kind of a toggle flag in paintcomponent? Regards Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by toneewa Yes, this is true. Overlapping ball spawns can do that causing a chain reaction. Something like that could be done. How you handle the spawning of the new ball is what I played with a bit before. You will see better collision detection changing to: g.fillOval(ball.getX(), ball.getY(), 1 * ball.getRadius(), 1 * ball.getRadius()); nested foreach loop issue Programming Web Development by mmcdonald …. I need to list the exam boards in a foreach loop giving each one an accordion. The certifications must be listed… the correct courses under their correct exam boards using a nested foreach loop. Thanks for any help! <div class="row… nested for loop and while loop Programming Software Development by daldrome … represented by the "*" in the nested for loop. I need to print out a square shape …"&" symbols but using a nested while loop. The target is such that if n=3…;& I've tried placing the nested while loop inside the for loop, but all it does is an …infinite loop :confused: [CODE=c++] #include <iostream&… nested for loop problem Programming Software Development by the b …paper scissors game, and in this game there is a nested for loop so that the players challenge each other, the outer… loop is supposed to loop through all the players starting with player 1, … trying to use doesn't work. Here is what the loop looks like: [CODE] for (j = 0; j < playerNum;… Finding pythagorean triples using triple-nested for loop Programming Software Development by the great … no longer than 500. I have to use a triple-nested for loop that tries all posibilities. I know that the sum… don't know how to try all posibilities using triple-nested loop. I am in a need of help.Can any one… PHP nested While loop Programming Web Development by mgt …and could use some help creating a nested "While" loop. The code below creates a drop… do I start the second "While" loop? Immediately after the first "{"? [code=… ("Error in query: $query. ".mysql_error()); // While Loop while($row = mysql_fetch_row($result)) { echo " <option… Re: PHP nested While loop Programming Web Development by mgt … to select specific values). 2) I want the nested "While" loop to produce output similar to the following: Value1 Value2… 2D array and nested for loop Programming Software Development by rikkie Hi guys, I'm trying to use a nested for loop to change the first 'o' it finds while testing to …an 's' and then exit the loop immediately after that. This is what I have, but it… Flow of a nested "For" loop Programming Software Development by cdea06 Could someone explain how the flow of control works with a nested for loop? [CODE]for (initialize; condition; increment) for (initialize; condition; increment) statement; [/CODE] I know a single for loop is: initialize --> condition --> statement --> increment--> condition -->....... Re: nested for loop c++ Programming Software Development by aluhnev can someone give steps,i know need nested for loop,but how to do comparesment? For Loop Won't Work....No errors in code at compile Programming Software Development by TylerTCF … here last, but ran into an interesting problem with a nested for loop that I cannot solve. Hoping someone here will know… is ending. For some reason VBA is not executing the loop at all. Does anyone know what I'm missing? Thanks… Re: HELP C++ Nested for loop Programming Software Development by mvmalderen Use [ICODE]cout << n << " ";[/ICODE] instead of [ICODE]cout << setw(5) << n << endl;[/ICODE] Right after the nested for-loop (line 17) you've put the following instruction: [ICODE]cout << endl;[/ICODE] The problem should be fixed now :) Nested Loops and Literal question Programming Software Development by beforetheyknew … wanted some clarification on two issues. Nested Loops, I just want to clarify … } [/CODE] How should i read a nested for loop? Like would this run essentially 30 times? Does…it basically run once, go into the nested loop, run 3 times, then go back into… the outer loop, then back into the nested loop 3 times? And I'v… Re: Nested Loops and Literal question Programming Software Development by darkagn …? So then does it basically run once, go into the nested loop, run 3 times, then go back into the outer… loop, then back into the nested loop 3 times?[/QUOTE] Yes, the inner code will… be run 30 times. Basically, the outer loop is run… Nested loop problem, plz help!!!! Programming Software Development by kentigens Hi, Im currently implimenting a nested for loop, but there seems to have some known bugs … values match.if match, wanna go back to the while loop but with i incremented. wire++; startcheck == true; i++; continue;…will return values that determines how many times the for loop will be looped index = urange[end.Z()].EdgeStartIndex + … Nested loop help Programming Software Development by rowley4 … just these. I know I can do this as a nested for loop. I am just not sure how... Any help would… nested for loops in JAVA Programming Software Development by gatorsgirl …. I am assuming I have made an error in my nested for loop, however I am not sure what it is, or… Re: Help with badly-behaving nested for loop? Programming Software Development by Xaenthe … make sure each part is working. I thought the nested for loop was necessary to request all the information and to keep… Re: nested while loops Programming Web Development by bibiki thanks darkgan for your reply. however, the code ought to work without the body tags. what the problem seems to be is that the while loop is a test on a boolean variable, which causes the inner (nested) while loop run only once... thank's for your reply, anyways.