Virtual bullet doesn't line up with real bullets

Jump to navigation Jump to search
Revision as of 3 October 2011 at 22:28.
The highlighted comment was created in this revision.

Virtual bullet doesn't line up with real bullets

I have a virtual gun that fires a virtual bullet, for some reason it's just slightly off when i actually fire.

MisalignedVirtualBullet.png

What's the proper way to align and fire? I think my timing is just off.

    Ultimatebuster22:56, 3 October 2011

    I would guess this is the result of the Robocode idiosyncrasy where a bullet is fired before the gun is turned (so if you do setTurnGunRightDegrees(10), setFire(3), execute(), the bullet is fired before the gun is turned right 10 degrees). So your actual aim is probably the aim from the previous turn, while your predicted is from the current turn.

      Skotty23:28, 3 October 2011