Re: Calling an object from another in PHP using construct Programming Web Development by FarrisFahad … A { private $obj; public function __construct() { $this->obj = new B(); } } class B { private $obj; public function __construct() { $this->obj = new… Re: Calling an object from another in PHP using construct Programming Web Development by jkon … A { private $obj; public function __construct() { $this->obj = new B(); } } class B { private $obj; public function __construct() { $this->obj = new… Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by jprog1000 …10; protected Timer timer; Ball b[]; public BallPanel(Ball b[]) { this.b= new Ball[b.length]; for (int i =…0; j <b.length; j++){ if (i!= j && b[i].collides(b[j])){ b[i].changeDirection(b[j]); } }… Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by toneewa …if (i != j && b.get(i).collides(b.get(j))) { if (b.get(i).changeDirection(b.get(j))) { collisionCount++; // Increment …y = 10 + i * 10; } while (!isFarEnough(x, y, b, i)); b[i] = new Ball (x, y, 40); } BallPanel bp = new… Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by toneewa …if (i != j && b.get(i).collides(b.get(j))) { if (b.get(i).changeDirection(b.get(j))) { collisionCount++; // Increment …y = 10 + i * 10; } while (!isFarEnough(x, y, b, i)); b[i] = new Ball(x, y, 25); } BallPanel bp = new … 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: Word Association Game Community Center Geeks' Lounge by Salem category -> pigeonhole Re: Word Association Game Community Center Geeks' Lounge by Reverend Jim pigeonhole --> stereotype Re: Word Association Game Community Center Geeks' Lounge by Salem stereotype -> similar Re: Printing multiple integers EASY SOLUTION Programming Software Development by Bunker A straightforward solution to printing multiple integers is to use a loop. For example, in Python, you could use a "for" loop to iterate through a list of integers and print each one. This method is simple and effective. Paris Olympics Chatbot- Get Ticket Information Using Chat-GPT and LangChain Programming Computer Science by usmanmalik57 … response. ``` query = "What is the maximum price for category B for men's single tennis games for non-medal games…?" generate_response(query) ``` **Output:** ``` The maximum price for category B for men's single tennis games for non-medal games… Re: Word Association Game Community Center Geeks' Lounge by Dani Seriously?! I need to go twice in a row b/c after almost two decades of this thread staying alive, no one's posted in 4 years? OK, fine ... snobby --> princess How do you use LLM AI tools in your daily programming workflow ? Community Center by jkon … to have a certain amount of experience to understand the B..S.. parts from the real useful ones. The coding hallucinations… The Rise of AI Scams: Deciphering Reality in a World of Deepfakes Community Center by Johannes C. … group A behaving violently against a member of imaginary group B, causing a moral panic that leads to actual violence between… VB2010- why i get a different vertical size\color on RayCasting? Programming Software Development by cambalinho …), RayCounts, 5) imgverticalline.ForeColor(RGB(VertColor.R, VertColor.G, VertColor.B)) imgverticalline.DrawLine(RayCounts, imgverticalline.Height / 2 - RayHeight \ 2, RayCounts, imgverticalline… Re: Design vs. Coding Programming Software Development by cored0mp … is good at three out of five (60%) is a B-level candidate and would probably get the job. Expectation value… Re: How can I upload a tar.bz2 file to openstack swift object storage container Programming Software Development by Salem …(len(bytes)) 10240 >>> print(str(bytes)[:80]) b'foo_1.txt\x00\x00\x00\x00\x00\x00\x00\x00… Re: How Build video-player in html And css ? Programming by Kirubel_2 …: 10px; border-radius: 15px; margin-left: 40%; margin-right: 5%; } #b{ transition: 1s all cubic-bezier(0.075, 0.82, 0… Re: 88 Business-Growing Strategies Digital Media Digital Marketing by henrymorgan9522 A growth strategy is an organization's plan for overcoming current and future challenges to realize its goals for expansion. Examples of growth strategy goals include increasing market share and revenue, acquiring assets, and improving the organization's products or services. Re: Fantastic word game Community Center Geeks' Lounge by Dani It's been a year so I'll go twice in a row. Corner that burglar before he gets away! Re: Word Association Game Community Center Geeks' Lounge by Salem princess -> castle Re: Word Association Game Community Center Geeks' Lounge by Dani Castle —> Tower