PDA

View Full Version : How Do I successfully create a counter? Why does my collision detection not work?


sorenkahl
12-09-2014, 04:20 PM
I am doing a final project for school and I can't figure out how to get my counter to work properly. When I go to play the world it already counts. Am I using wrong codes to get this to work properly? Any advice would be helpful. I am including my world. The method I am using is located in the world methods. It's called CheckForBroccoli. Also how do I get my bunny to stop going into the ground? My collision detection code isn't working properly.

Thanks for the Help,

sorenkahl:confused:

RavenOfCode
12-09-2014, 05:36 PM
Heres a fix for your final as best as I understand it.

What I changed is listed in myfirstmethod near the bottom.

Hope this helps!
RavenOfCode

sorenkahl
12-09-2014, 10:26 PM
Hey Thanks for the help if I have any more questions I'll be sure to post them

-sorenkahl

RavenOfCode
12-11-2014, 05:19 PM
Here's the way to make the broccoli align correctly.

It used a variable and a do in order.

sorenkahl
12-16-2014, 12:50 AM
I've copied all of your work onto my new updated world and I'm having some major bugs what did I mess up on?

Thanks
-sorenkahl

RavenOfCode
12-16-2014, 06:21 AM
You didn't copy the code right, put the IncrementDistanceBy1 into the forAllInOrder. As that makes it increment every time a broccoli moves, not after they all move.