Computer Science Canada glitch in game, code flawed?! |
Author: | ZeroPaladn [ Fri Dec 02, 2005 10:14 am ] | ||
Post subject: | glitch in game, code flawed?! | ||
im making a little shooting game just for the hell of it, and i got the movement, and the health/heat done. The problem is the laser. what i want it to do is you shoot it, then it moves independantly of the "cannon", which is fixed by assigning the cuttent y value to a new value, and the laser moves along that value ONLY. when i try it out, its bugs, and player 2 gets a massive speed boost (which is not suposed to happen) and the laser stays at the default coordinate (which is 15 when yous tart, because of my wall collision detection.) hers the code.
thanks in advance. |
Author: | Tony [ Fri Dec 02, 2005 10:30 am ] | ||||
Post subject: | |||||
first of all it's
then as you call cannons from inside that for loop, you check for movement without delays for that many steps. you also don't need an if statement to tell when the forloop is done, just place it outside of the loop
Also your lazer1 and lazer2 loops are separate, so while one is firing, another one can't |
Author: | ZeroPaladn [ Fri Dec 02, 2005 11:53 am ] |
Post subject: | |
oops thanks tony, ill fix those. |