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. Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development 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 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 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 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 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 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 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 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 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: Trying to animate sprite using DirectX9 Programming Software Development 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 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 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 by snah19 …; helloai.c <<EOF #include <stdio.h> int main() { printf("Hello, world!\\n"); return 0; } EOF… Re: C++ programming error Programming 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 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 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 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 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 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 by Sachin_41 what is _response in this? Is this some library? Re: Problem Returning MySQL Stored Procedure results using Python Programming Databases 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 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.