Stuck on balls bouncing off walls
-
- Posts: 5
- Joined: April 22nd, 2017, 1:42 am
Stuck on balls bouncing off walls
I've been working through the tutorials and for the last week on the Fart-Annoyed game. I got stuck on the part where we teach the ball to bounce off the walls. I haven't attached code yet because after I cleaned and zipped it, the folder was still 119 mb, I was afraid of clogging the website with an oversized folder. But I have the cleaned and zipped file ready in case I should share it anyway.
What seems to be happening is that the ball's GetRect call is not initializing rect with its left, right, top, and bottom floats. It gets the position, halfWidth, and halfHeight fine but with the rest uninitialized it immediately thinks the ball is outside the walls and overcorrects its position.
I'm using Visual Studio 2017 for this in case that makes any difference.
So I have multiple questions - Has anyone else had this same problem? Is it normal to have such a big solution folder after cleaning and zipping? And should I share it anyway?
What seems to be happening is that the ball's GetRect call is not initializing rect with its left, right, top, and bottom floats. It gets the position, halfWidth, and halfHeight fine but with the rest uninitialized it immediately thinks the ball is outside the walls and overcorrects its position.
I'm using Visual Studio 2017 for this in case that makes any difference.
So I have multiple questions - Has anyone else had this same problem? Is it normal to have such a big solution folder after cleaning and zipping? And should I share it anyway?
-
- Posts: 432
- Joined: September 26th, 2013, 4:57 pm
- Location: Kentucky
- Contact:
Re: Stuck on balls bouncing off walls
No it should be under 1mb most likely unless you've added large asset files.migueltherat wrote:I've been working through the tutorials and for the last week on the Fart-Annoyed game. I got stuck on the part where we teach the ball to bounce off the walls. I haven't attached code yet because after I cleaned and zipped it, the folder was still 119 mb, I was afraid of clogging the website with an oversized folder. But I have the cleaned and zipped file ready in case I should share it anyway.
What seems to be happening is that the ball's GetRect call is not initializing rect with its left, right, top, and bottom floats. It gets the position, halfWidth, and halfHeight fine but with the rest uninitialized it immediately thinks the ball is outside the walls and overcorrects its position.
I'm using Visual Studio 2017 for this in case that makes any difference.
So I have multiple questions - Has anyone else had this same problem? Is it normal to have such a big solution folder after cleaning and zipping? And should I share it anyway?
PM me if you need to contact me. Thanks to all the helpful people on this forum especially to Chili.
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: Stuck on balls bouncing off walls
The only time I've seen solutions that large are with sounds and images. The Visual Studio files that accompany your solution can usually be around 50MB+. The only things necessary ( with the exception of assets like sound or images ) are the .sln file and the sub-folder with all your .h, .cpp, .vcxproj and .vcxproj.filter files. The .filter file is what keeps track of any filter folders in the Solution Explorer. The .vcxproj file is all your project settings. All Debug and Release folders ( including the ones in your project sub-folder ) should be deleted.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: Stuck on balls bouncing off walls
The best thing to do then is create a GitHub account and post to there. Then share the link here.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
-
- Posts: 5
- Joined: April 22nd, 2017, 1:42 am
Re: Stuck on balls bouncing off walls
Thanks for the help. I'm trying to upload my branch onto a new GitHub account I just created, but so far when I try to sync it to my new repository, Visual Studio keeps telling me that my branch doesn't exist in the repository. I'll tackle it again tomorrow.
- krautersuppe
- Posts: 91
- Joined: September 14th, 2015, 10:58 pm
- Location: Istanbul
Re: Stuck on balls bouncing off walls
Did you use ChiliClean http://www.planetchili.net/downloads/chili_clean.zip ?migueltherat wrote:I've been working through the tutorials and for the last week on the Fart-Annoyed game. I got stuck on the part where we teach the ball to bounce off the walls. I haven't attached code yet because after I cleaned and zipped it, the folder was still 119 mb, I was afraid of clogging the website with an oversized folder. But I have the cleaned and zipped file ready in case I should share it anyway.
So I have multiple questions - Has anyone else had this same problem? Is it normal to have such a big solution folder after cleaning and zipping? And should I share it anyway?
I used it and had the same issue.After you have executed chiliclean just delete a hidden folder named .vs and it should be fine.
DSU
Discord: dsu1, GitHub: https://github.com/DSpUz
Discord: dsu1, GitHub: https://github.com/DSpUz
-
- Posts: 5
- Joined: April 22nd, 2017, 1:42 am
Re: Stuck on balls bouncing off walls
Thanks, krautersuppe. I'm having no luck uploading to GitHub. I had used ChiliClean before, just tried your suggestion and it worked.
So here's the solution folder down to less than 1 mb attached. I'm still new enough at this that I think but am not sure that the folder includes everything I downloaded from the tutorial GitHub page plus my changes. My changes are on a branch that I called T20MainBranch. The commit that I'm stuck on I called Stuck on DoWallCollision in Ball.cpp.
So here's the solution folder down to less than 1 mb attached. I'm still new enough at this that I think but am not sure that the folder includes everything I downloaded from the tutorial GitHub page plus my changes. My changes are on a branch that I called T20MainBranch. The commit that I'm stuck on I called Stuck on DoWallCollision in Ball.cpp.
- Attachments
-
- Fart-Annoyed Game.zip
- (670.14 KiB) Downloaded 160 times
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: Stuck on balls bouncing off walls
Here's the problem
Code: Select all
RectF::RectF(const Vec2 & topLeft, const Vec2 & bottomRight)
{
RectF(topLeft.x, bottomRight.x, topLeft.y, bottomRight.y);
}
RectF::RectF(const Vec2 & topLeft, float width, float height)
{
RectF(topLeft, topLeft + Vec2(width, height));
}
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: Stuck on balls bouncing off walls
Same issue as this one
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
-
- Posts: 5
- Joined: April 22nd, 2017, 1:42 am
Re: Stuck on balls bouncing off walls
Excellent, that did it. Thank you very much, albinopapa. The one thing I'm still scratching my head about is that the same change was not needed for the function that DoWallCollision was calling. I'm guessing that's because it isn't a constructor even though it's imitating one?
And for future reference is that preferred for constructors in general - put the parameters between the colon and the first curlybrace rather than within the curlybraces?
And for future reference is that preferred for constructors in general - put the parameters between the colon and the first curlybrace rather than within the curlybraces?