[Pogamut-list] Alternative shoot
michal.bida
pogamut-forum at artemis.ms.mff.cuni.cz
Thu Mar 12 13:12:17 CET 2009
Re: Re: Re: Alternative shoot
Author: michal.bida
Yeah, this is a bit tricky now in the Pogamut, but not impossible... :-)
> With some weapons (lets say Shield Gun) you can have three options:
> 1.- Pressing once the left mouse button -> one shoot. -> command: this.body.shoot
Shooting once with a charging weapon is a little bit tricky. To shoot once you need to call
this.body.shoot and right away or in the next logic iteration
this.body.stopshoot
Basically calling these two methods in sequence should work:
this.body.shoot();
this.body.stopshoot();
> 2.- Pressing right mouse button (and hold it) -> shield -> command: ?
Just call this.body.shootalternate (dont remember the exact name). Your bot will be "holding the right mouse button" until you call stopshoot method.
> 3.- Pressing and holding left mouse button -> you charge a powerful shoot, but you don´t shoot yet -> command: ?
> 3.1 - When release, then you shoot that powerful shoot -> command: ?
Here you call this.body.shoot() first to start charging the weapon. The bot won't fire, because shoot command works differently with charging weapons and shield gun is a charging weapon. When you think that you've charged the weapon enough just call stopshoot method and the bot will fire.
> or the Rocket Launcher:
> 1.- Pressing once left mouse button -> one shoot -> command: this.body.shoot
This firing mode is not charging. so calling this.body.shoot(); is enough and the bot will continue firing rockets one by one until you call stopshoot method.
> 2.- Pressing once right mouse button -> the same shoot than before -> command: this.body.shootAlternate
This is charging mode, so to fire once, you need to
this.body.shootAlternate();
this.body.stopshoot();
> 3.- Pressing and holding right mouse button -> 2 or even 3 misils at the same time -> command: ?
You start charging the weapon with method this.body.shootAlternate() and when you think you charged enough you call stopshoot method.
Don't forget that the bot will fire automatically anyway some time after he reached maximum charge - 3 rockets at once.
> 4.- Pressing and holding right mouse button, and, in the right moment, click left mouse button -> 2 or even 3 misils at the same time following a spiral trajectory -> command: ?
Unfortunately, I don't think this is possible for bots in Pogamut at this time.
The tricky thing is, that the shoot, stopshoot and shootalternate methods behavior can be different for different weapons. Mostly it depends on whether the firing mode you are using (if you are a player it means whether you use left or right mouse button to fire the weapon) is charging or not.
There is not enough comments in the code for this, because we encountered these problems a bit late. If you have more questions just post it here.
Cheers,
michal
More information about the Pogamut-list
mailing list