Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
b
- Page 1
Re: Calling an object from another in PHP using construct
Programming
Web Development
3 Hours Ago
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
5 Days Ago
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
4 Weeks Ago
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
4 Weeks Ago
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
4 Weeks Ago
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
4 Weeks Ago
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
4 Weeks Ago
by Dani
I’ll mark this question solved :)
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
4 Weeks Ago
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
3 Weeks Ago
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
3 Weeks Ago
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
2 Weeks Ago
by jprog1000
Got it. Thank you so much!
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
2 Weeks Ago
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
2 Weeks Ago
by jprog1000
Great reply, vortex! Agree with all your points.
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
2 Weeks Ago
by aishamushtaq
Hi, Its helpful for me. I got my answer.
Re: Word Association Game
Community Center
Geeks' Lounge
4 Weeks Ago
by Salem
category -> pigeonhole
Re: Word Association Game
Community Center
Geeks' Lounge
4 Weeks Ago
by Reverend Jim
pigeonhole --> stereotype
Re: Word Association Game
Community Center
Geeks' Lounge
3 Weeks Ago
by Salem
stereotype -> similar
Re: Printing multiple integers EASY SOLUTION
Programming
Software Development
1 Week Ago
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
1 Month Ago
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
1 Month Ago
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
2 Months Ago
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
2 Months Ago
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
1 Month Ago
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
2 Months Ago
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
1 Month Ago
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
1 Month Ago
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
1 Month Ago
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
1 Month Ago
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
1 Month Ago
by Salem
princess -> castle
Re: Word Association Game
Community Center
Geeks' Lounge
1 Month Ago
by Dani
Castle —> Tower
1
2
3
17
Next
Last
Search
Search
Forum Categories
Hardware/Software
Programming
Digital Media
Community Center
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Forums
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC