Computer Science Canada Bullet gets fast when Shooter near border, why? |
Author: | riveryu [ Fri Mar 07, 2008 7:54 pm ] | ||
Post subject: | Bullet gets fast when Shooter near border, why? | ||
The shooter appears to be shooting faster as he gets closer to the border, why is that? How do you fix it so that the rate of bullet shooting remains constant no matter what? Also, how do you make it so that the shooter has the same movement speed while shooting? Please give specific answers, I'm just curious after I tested out the code below. Below is code quoted from jamonathin, on Why You Should Avoid Processes
|
Author: | riveryu [ Fri Mar 07, 2008 8:22 pm ] |
Post subject: | Re: Bullet gets fast when Shooter near border, why? |
I answered one of my own questions, Bullet gets fast when Shooter near border, why? Because the shooter can only shoot again when the bullet hits the maxy -10, the shorter distance the faster the bullet gets to its destination, the faster the shooter can shoot again. I attempted to fix the problem by making the limit for the bullet further up the maxy. -500> maxy Is there an already determined value for how far should the limit be for your bullet to remain constant? |
Author: | Dan [ Fri Mar 07, 2008 8:37 pm ] | ||
Post subject: | RE:Bullet gets fast when Shooter near border, why? | ||
It's probly not a good idea to be calling movement from shoot and shoot from movement. That sets up some wired recursion that is realy not nessary. Idealy you should be able to put most of that code in a singal loop that checks for key preses as well as moves the bulite and draws everything. You could still break it down more in to procudures but it might be easyer to start with just a loop:
|
Author: | riveryu [ Sun Mar 09, 2008 1:00 pm ] |
Post subject: | RE:Bullet gets fast when Shooter near border, why? |
Thanks a lot, Dan |