Exemplo n.º 1
0
 public TankObject( Vector2 position, float rotation, Colors color, KeySet keys, float scale, int shotlimit, int shottime, int fencelimit, int fencetime, float speed, float bulletspeed, string teamString, bool teamShield, bool teamGhost, bool selfish )
 {
     Position = position;
     OP = position;
     angle = rotation;
     OR = MathHelper.ToRadians( rotation );
     TankColor = color;
     Keys = keys;
     IsInGame = true;
     IsOfficiallyOut = false;
     Score = 0;
     OS = scale;
     Scale = scale;
     ShotLimit = shotlimit;
     ShotTime = shottime;
     FenceLimit = fencelimit;
     FenceTime = fencetime;
     random = new Random();
     OSP = speed;
     Speed = OSP;
     BulletSpeed = bulletspeed;
     TeamString = teamString;
     TeamShield = teamShield;
     TeamGhost = teamGhost;
     Selfish = selfish;
 }
Exemplo n.º 2
0
 private KeySet LoadSetting( string setting, KeySet defaultSetting )
 {
     string keystr = LoadSetting( setting );
     if ( keystr == "" ) return defaultSetting;
     string[] keys = keystr.Replace( " ", string.Empty ).Split( ',' );
     return new KeySet(
     LoadKey( keys, 0, defaultSetting.KeyUp ),
     LoadKey( keys, 2, defaultSetting.KeyDown ),
     LoadKey( keys, 1, defaultSetting.KeyLeft ),
     LoadKey( keys, 3, defaultSetting.KeyRight ),
     LoadKey( keys, 4, defaultSetting.KeyPlace ),
     LoadKey( keys, 5, defaultSetting.KeyShoot ) );
 }