Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
int
- Page 1
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
2 Days Ago
by jprog1000
Got it. Thank you so much!
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
1 Day 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
1 Day 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
1 Day Ago
by Digital_39
Hi, Its helpful for me. I got my answer.
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
1 Week Ago
by toneewa
… ); frame.setVisible( true ); } private static boolean isFarEnough(
int
x,
int
y, Ball[] balls,
int
upToIndex) { for (
int
i = 0; i < upToIndex; i++) { Ball…
Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
1 Week Ago
by jprog1000
… class Ball{ private
int
x = 0; private
int
y = 0; private
int
radius; private
int
panelwidth = 500; private
int
panelheight = 500; private
int
xDx = 1; private…
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
1 Week Ago
by toneewa
…
int
x; private
int
y; private final
int
radius; final
int
panelheight = 500; final
int
panelwidth = 500; private
int
xDx = 1; private
int
…(true); } private static boolean isFarEnough(
int
x,
int
y, Ball[] balls,
int
upToIndex) { for (
int
i = 0; i < …
How to Optimize RecyclerView performance by implementing the ViewHolder
Programming
Mobile Development
1 Week Ago
by Mikekelvin
…} } @Override public ViewHolder onCreateViewHolder(ViewGroup parent,
int
viewType) { View view = LayoutInflater.from(parent…(view); } @Override public void onBindViewHolder(ViewHolder holder,
int
position) { holder.textView.setText("Item " …
Re: GCC Fails to Recognize Parameters
Programming
3 Weeks Ago
by toneewa
….h> #include <libavformat/avio.h> }
int
main() { AVFormatContext* fmt_ctx = NULL;
int
ret; // read the header of input stream. ret…
Slaying Unicorns: How Europe Sabotages Its Own Economic Future
Community Center
2 Weeks Ago
by Johannes C.
… for some reason, the [heavily subsidized European](https://rm.coe.
int
/file-2-marius-report-eng/1680a4d519) media hardly mentions such…
Re: Improve HAVING BY performance
Programming
Databases
1 Week Ago
by toneewa
…* driver; sql::Connection* con; sql::Statement* stmt;
int
ct = 0;
int
main(){ while(ct!=5){ try { driver = sql::… result = stmt->getResultSet(); while (result->next()) {
int
id = result->getInt("ProductID"); string name = …
Re: Read file properties of video files in C++
Programming
Software Development
1 Week Ago
by toneewa
….h> #include <libavformat/avio.h> }
int
main() { AVFormatContext* fmt_ctx = NULL;
int
ret; // read the header of input stream. ret…
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
1 Week 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
1 Week Ago
by Dani
I’ll mark this question solved :)
Re: Bouncing Balls: Creating a new ball when two balls collide
Programming
Software Development
1 Week 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
1 Week 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
1 Week 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: Trying to animate sprite using DirectX9
Programming
Software Development
3 Weeks Ago
by Pavel_11
Hello, it is unneccessarily to use right movex or leftmovex , because it is to much variables. You should to use one variable movex to make it with minus or plus sign in your update function; by pressing left or right keys; because the one thing which is changable is a picture; I mean in global sense; variables like leftx, right x should be one…
VB6 - RayCasting: why my Vertical intersection is so big?
Programming
Software Development
2 Months Ago
by cambalinho
…AY = Player.PosY AX = Player.PosX Else 'Facing Up AY = (
Int
(Player.PosY / ObjectSize) * ObjectSize) - 1 AX = Player.PosX + …AY = Player.PosY AX = Player.PosX Else 'Facing left AX = (
Int
(Player.PosX / ObjectSize) * ObjectSize) - 1 AY = Player.PosY +…
Re: VB6 - RayCasting: why my Vertical intersection is so big?
Programming
Software Development
2 Months Ago
by cambalinho
…Player.PosY AX = Player.PosX Else 'Facing Up AY = (
Int
(Player.PosY / ObjectSize) * ObjectSize) - 1 AX = Player.….PosY AX = Player.PosX Else 'Facing left AX = (
Int
(Player.PosX / ObjectSize) * ObjectSize) - 1 AY = Player…
GCC Fails to Recognize Parameters
Programming
1 Month Ago
by snah19
…; helloai.c <<EOF #include <stdio.h>
int
main() { printf("Hello, world!\\n"); return 0; } EOF…
Re: C++ programming error
Programming
1 Month Ago
by rproffitt
…/escape Example follows: #include <iostream> using namespace std;
int
main() { cout << "furey, edward \"sphere calculator…
Re: VB6 - RayCasting: why my Vertical intersection is so big?
Programming
Software Development
2 Months Ago
by rproffitt
For VertDist I would set a break on line 104 so I could examine the values in line 103. Also, could be a localization issue that the comma is used for the decimal point and the integer of the results might be 35 and 4548.
Re: VB6 - RayCasting: why my Vertical intersection is so big?
Programming
Software Development
2 Months Ago
by cambalinho
finally i found the problem is on these line: HorizDist = Sqr(((HorizX - Player.PosX) * (HorizX - Player.PosX)) + ((HorizY - Player.PosY) * (HorizY - Player.PosY))) 'works fine VertDist = Sqr(((VertX - Player.PosX)) * ((VertX - Player.PosX))) + (((VertY - Player.PosY)) * ((VertY - Player.PosY)))'calculation incorrect like …
Re: VB6 - RayCasting: why my Vertical intersection is so big?
Programming
Software Development
2 Months Ago
by cambalinho
not so easy :( WallDistance = WallDistance * Cos(Abs(RayRadians - Player.Radians)) 'avoiding the Fish Effect RayHeight = (ObjectSize / WallDistance) * 200 '320 is the width screen If (RayHeight > 200) Then RayHeight = 200 A.ForeColor vbBlue A.DrawLine 475 + 50 + RayCounts, 200 / 2 - …
Re: VB6 - RayCasting: why my Vertical intersection is so big?
Programming
Software Development
2 Months Ago
by cambalinho
i fix 1 error: ElseIf (KeyCode = vbKeyUp) Then If (LevelMap0(Fix((Player.PosY + Player.MoveY * Speed) / ObjectSize), Fix((Player.PosX + Player.MoveX * Speed) / ObjectSize)) <> vbBlue) Then 'and: ElseIf (KeyCode = vbKeyDown) Then If (LevelMap0(Fix((Player.PosY - Player.MoveY * Speed) / …
Re: VB6 - RayCasting: why my Vertical intersection is so big?
Programming
Software Development
2 Months Ago
by cambalinho
after several tests i fix it: Do While RayCounts < RayCount If (RayRadians > (2 * PI)) Then RayRadians = 0.001 i have more to update: 1 - win more performance\FPS; 2 - and trying avoid the 'on error resume next'(it's about the array dimensions): Private Sub DrawRays2() Dim AY As Double…
Re: Download multiple files in single zip and render for download
Programming
Software Development
2 Months Ago
by Sachin_41
what is _response in this? Is this some library?
Re: Problem Returning MySQL Stored Procedure results using Python
Programming
Databases
2 Months Ago
by Dani
Haha, good job! Thanks for sharing your solution. Sometimes that happens with me. As you type it up, you think about how to phrase what's wrong and what needs to happen, and it makes you think about it from different angles, and you figure it out.
Re: GCC Fails to Recognize Parameters
Programming
1 Month Ago
by Reverend Jim
I can't offer any suggestions other than to just download the compiled app for your system instead of building it yourself.
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
Meet People
Forums
Top Members
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