Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by jprog1000 Hello, I have a program which creates multiple balls and bounces them off when they collide. This works fine. import java.awt.Rectangle; public class Ball{ private int x = 0; private int y = 0; private int radius; private int panelwidth = 500; private int panelheight = 500… 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 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 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 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()); 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 aishamushtaq Hi, Its helpful for me. I got my answer. Re: Is Coding About Authoring or Achieving a Specification? Programming by Reverend Jim As an example, here is some code we got from a vendor. It is rock-solid. It does what it is supposed to but it is virtually unmaintainable. I can't begin to imagine how it was ever debugged. SUBROUTINE READALL(UNIT,BUFF,*,*,IFIRST) C*TTL READALL READ FROM ANYTHING C THIS SUBROUTINE IS USED FOR READING COMPRESSED OR … Re: How can I upload a tar.bz2 file to openstack swift object storage container Programming Software Development by Salem First, let's prepare two tar files using different compression schemes for demo purposes. $ cat foo_1.txt This is file 1 $ cat foo_2.txt This is file 2 This is file two This is file too # Three tar files, two compressed and one uncompressed for reference $ tar -j -c -f foo.tar.bz2 foo_1.txt foo_2.txt… J.A.M.D. Hardware and Software Linux and Unix by Z28James over the last few weeks ive tried out rh8, mdk 9.1, knoppix 3.1, gentoo, yoper, debian sarge, and j.a.m.d and by far...except for gentoo, j.a.m.d was the coolest in my opinion. its a slimmer version of rh8 recompiled for i686 cpus. you all should try it...i like it alot. but i do admit i like gentoo...well purely cuz of the fact that i got it to … Re: 'J' Suffix and Swing Programming Software Development by VernonDozier [QUOTE=curtissumpter;802419]Is it safe to assume that any object that is preceded with the letter 'J' is a member of the Swing package? Just trying to get lightweight versus heavyweight components sorted properly. Thanks. -- Curtis[/QUOTE] It's mostly, but not all, Swing. Here are the J's [url]http://java.sun.com/javase/6/docs/api/… J# invalid paramater at runtime Programming Software Development by alcoheca Hi, I have this issue with a J# project I need to complete for uni. [CODE=java]public class Sprite { private Image m_image; public Sprite(Image image) { m_image = image; } public int getWidth() { return m_image.get_Width(); } public int getHeight() { return m_image.get_Height(); } public void draw(Graphics g, int x, int y) {… Re: J# invalid paramater at runtime Programming Software Development by alcoheca No one has any idea? start of rant: MSDN Forums are dead, no one is using J#, my lecturer is useless.. why force us to use this language with such limited support docs, examples, etc... 'J' Suffix and Swing Programming Software Development by curtissumpter Is it safe to assume that any object that is preceded with the letter 'J' is a member of the Swing package? Just trying to get lightweight versus heavyweight components sorted properly. Thanks. -- Curtis Re: 'J' Suffix and Swing Programming Software Development by stultuske [QUOTE=curtissumpter;802419]Is it safe to assume that any object that is preceded with the letter 'J' is a member of the Swing package? Just trying to get lightweight versus heavyweight components sorted properly. Thanks. -- Curtis[/QUOTE] assuming this could get you into a lot of unknown problems when using an openSource package. any Joe-… Re: J.F.K. assassination Community Center Geeks' Lounge by sk8ndestroy14 Well, here goes, vaguely (sp). J.F.K. serioudly talked about dismantling the C.I.A. This would put all of them out of jobs and the C.I.A. obviously didn't want that. "Why was Lee Harvey Oswald allowed back into the United States after defecting to the Soviet Union with virtually no questions asked?" Oswald's office in New Orleans was the … Infected j think Hardware and Software Information Security by waterfrom Infected? The computer restart by it self. and say it recover after a big fail and its save a log file too( minilog) Possible virus ,But j cant find anything. Windows XP SP2. Avg antivirus 8.0 Windows built in firewall J have run this programs avg fullscan eset onlinescan spyboot search destroy malwarebytes,anti-malware. ccleaner Hijack this(… Re: Infected j think Hardware and Software Information Security by waterfrom what j call minilog is the Minidump file.. This have going on for3-4weeks now. shutdown 5-6 times every day and it say it have recover after a critical error. It`s drive me crazy. J have done all j come up with. Please help Re: Infected j think Hardware and Software Information Security by waterfrom hello. J run eset antivirus and M alwareAnti malware, ccleaner ,atf cleaner. spyware terminator.j downloaded eset and run the scan. and j run mcafee rootkit detective. How large is the hard drive? j got 185 gb free space How much RAM is installed? About 1536Ram When do these occur? not sure what you mean What are you doing … Re: Infected j think Hardware and Software Information Security by waterfrom hello sorry forgot hijackthis log her it is. And yes j have follow every step for clean computer Re: Infected j think Hardware and Software Information Security by waterfrom hello. J just try to take away avg if that was theproblem, but the same thing happend again, back to avg. Yes j dont have many program on my pc. ye it could be, But j not sure what services shall run and what j can disable? Re: Infected j think Hardware and Software Information Security by waterfrom hello again j just run combofix and it was few things there that combofix repair. The one thing combofix fix was some recovery file and 3 more files. That was cool enough. But j run mcafee rootkit detective, and it was something there that was not there earlyer. Is they a problem? 'Object-Type: SSDT-hook Object-Name: … Re: Infected j think Hardware and Software Information Security by waterfrom Hello. Sorry. Am understand now how frustrating that was for you. J am very very Sorry, but j was so frustrated with the shutdown all the time, and j was not able to run my web store. Am sorry j run those programs. j did not do anyhing with the mcAfee program. But j run the combofix . J was not sure if combofix was that powerful tool, if … how i can come to know which button is selected (or how i can pass i,j as an argument Programming Software Development by sat21091 hi guys please help me i want to know how i can pass an i ,j argumaents to the function abc so that i can do oprations on i, j in function abc [code]Button[,] b = new Button[8, 8]; void drawchessboard() { int x=60, y=10,z=0; for (int i = 0; i < 8; i++) { for… Re: What happens to the value of i and j in the function? Programming Software Development by MandrewP [QUOTE=hey.howdy;1783025][CODE] #include<iostream> using namespace std; void comparison(char arr2[], char arr3[],int& i,int j) { int abc=1; for(j=0;j<5;j++) { if((arr2[j]==arr3[j])||(arr2[0]!=arr3[0])) { j++; } i=i+1; j=5; } } int main() { char arr[5]={'a','b','c','d','e'}; char arr1[5]={'a','b','c','d','e'}; int refr=0, iteratorr…