本文整理汇总了C#中AcademyPopcorn.MatrixCoords类的典型用法代码示例。如果您正苦于以下问题:C# MatrixCoords类的具体用法?C# MatrixCoords怎么用?C# MatrixCoords使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MatrixCoords类属于AcademyPopcorn命名空间,在下文中一共展示了MatrixCoords类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: TrailObject
// The new constructor
public TrailObject(MatrixCoords matrixCoord, uint turns)
: base(matrixCoord, new char[,] { {Symbol} })
{
if (turns == 0)
throw new ArgumentException("Turns of the trailing object must be a positive integer number.");
this.turns = turns;
}
开发者ID:PetarPenev,项目名称:Telerik,代码行数:8,代码来源:TrailObject.cs
示例2: GiftBlock
public GiftBlock(MatrixCoords topLeft, Gift gift)
: base(topLeft)
{
this.CurrentGift = gift;
this.CurrentGift.SetTopLeft(topLeft);
this.body = new char[,] { { GiftBlock.Symbol } };
}
开发者ID:razsilev,项目名称:TelerikAcademy_Homework,代码行数:7,代码来源:GiftBlock.cs
示例3: Print
public void Print(List<dynamic> infoBar, MatrixCoords topLeft)
{
for (int line = 0; line < infoBar.Count; line++)
{
Console.SetCursorPosition(topLeft.Col, topLeft.Row + line);
Console.WriteLine(infoBar[line]);
}
}
开发者ID:Termininja,项目名称:TelerikAcademy,代码行数:8,代码来源:Infofield.cs
示例4: BulletRacket
private int shotsLeft; // Bullet Racket has limmited number of shots
#endregion Fields
#region Constructors
public BulletRacket(MatrixCoords topLeft, int width)
: base(topLeft, width)
{
this.body[0, 0] = '!'; // draw left gun
this.body[0, this.body.GetLength(1)-1] = '!'; // draw right gun
this.shotsLeft = 10; // Bullet Racket has only 10 shots loaded
hasShooted = false;
}
开发者ID:psotirov,项目名称:TelerikAcademyProjects,代码行数:14,代码来源:BulletRacket.cs
示例5: TrailObject
public TrailObject(MatrixCoords topLeft, char[,] body, int lifeTime)
: base(topLeft, body, new MatrixCoords(0,0))
{
if (lifeTime <= 0)
{
throw new IndexOutOfRangeException("The life time can not be negative");
}
this.lifeTime = lifeTime;
}
开发者ID:KirilToshev,项目名称:Projects,代码行数:9,代码来源:TrailObject.cs
示例6: Update
public void Update(MatrixCoords coords)
{
this.Lifetime--;
if (this.Lifetime <= 0)
{
this.IsDestroyed = true;
}
this.topLeft = coords;
}
开发者ID:hristian-dimov,项目名称:TelerikAcademy,代码行数:9,代码来源:TrailObject.cs
示例7: ProduceObjects
public override IEnumerable<GameObject> ProduceObjects()
{
List<GameObject> produced = new List<GameObject>();
if (this.IsDestroyed)
{
MatrixCoords newRacketCoords = new MatrixCoords(this.TopLeft.Row + 1, this.TopLeft.Col);
produced.Add(new ShootingRacket(newRacketCoords, 6));
}
return produced;
}
开发者ID:Varbanov,项目名称:TelerikAcademy,代码行数:10,代码来源:Gift.cs
示例8: TrailObject
public TrailObject(MatrixCoords topLeft, char[,] body, int lifeTime)
: base(topLeft, body)
{
this.TopLeft = topLeft;
int imageRows = body.GetLength(0);
int imageCols = body.GetLength(1);
this.body = body;
this.IsDestroyed = false;
this.LifeTime = lifeTime;
}
开发者ID:aleks-todorov,项目名称:HomeWorks,代码行数:10,代码来源:TrailObject.cs
示例9: TrailObject
public TrailObject(MatrixCoords topLeft, char[,] body, int lifetime)
: base(topLeft, body)
{
if (lifetime < 1)
{
throw new ArgumentOutOfRangeException("Life time can not be less then 1.");
}
this.lifetime = lifetime;
}
开发者ID:razsilev,项目名称:TelerikAcademy_Homework,代码行数:10,代码来源:TrailObject.cs
示例10: CollisionData
public CollisionData(MatrixCoords collisionForceDirection, List<string> hitObjectsCollisionGroupStrings)
{
this.CollisionForceDirection = collisionForceDirection;
this.hitObjectsCollisionGroupStrings = new List<string>();
foreach (var str in hitObjectsCollisionGroupStrings)
{
this.hitObjectsCollisionGroupStrings.Add(str);
}
}
开发者ID:PetarPenev,项目名称:Telerik,代码行数:11,代码来源:CollisionData.cs
示例11: GameObject
protected GameObject(MatrixCoords topLeft, char[,] body)
{
this.TopLeft = topLeft;
int imageRows = body.GetLength(0);
int imageCols = body.GetLength(1);
this.body = this.CopyBodyMatrix(body);
this.IsDestroyed = false;
}
开发者ID:RRRRRRRRRR,项目名称:thegodmode.github.com,代码行数:11,代码来源:GameObject.cs
示例12: ProduceObjects
public override IEnumerable<GameObject> ProduceObjects()
{
if (this.IsDestroyedByRacket)
{
// TODO create fire racket
var racketTopLeft = new MatrixCoords(this.topLeft.Row + 1, this.topLeft.Col);
var racket = new ShootingRacket(racketTopLeft, 6);
return new GameObject[] { racket };
}
return base.ProduceObjects();
}
开发者ID:razsilev,项目名称:TelerikAcademy_Homework,代码行数:13,代码来源:FireGift.cs
示例13: Run
public virtual void Run(List<dynamic> list, MatrixCoords topLeft)
{
while (true)
{
// Print every object over the screen
this.renderer.RenderAll();
// Set game speed
System.Threading.Thread.Sleep(520 - 5 * Speed);
// Check for user input
this.userInterface.ProcessInput();
// Clear all objects from the screen
this.renderer.ClearQueue();
// For each objects the new position is updated
foreach (var obj in this.allObjects)
{
obj.Update();
this.renderer.EnqueueForRendering(obj);
}
// Check for collisions
CollisionDispatcher.HandleCollisions(this.movingObjects, this.staticObjects);
// Check for produced objects
List<GameObject> producedObjects = new List<GameObject>();
foreach (var obj in this.allObjects)
{
producedObjects.AddRange(obj.ProduceObjects(playerRacket.TopLeft.Col));
}
// Delete all dead objects
this.allObjects.RemoveAll(obj => obj.IsDestroyed);
this.movingObjects.RemoveAll(obj => obj.IsDestroyed);
this.staticObjects.RemoveAll(obj => obj.IsDestroyed);
// Add all produced objects in the list
foreach (var obj in producedObjects)
{
this.AddObject(obj);
}
// Print the information field
Infofield infoField = new Infofield();
infoField.Print(list, topLeft);
}
}
开发者ID:Termininja,项目名称:TelerikAcademy,代码行数:49,代码来源:Engine.cs
示例14: ProduceObjects
public override IEnumerable<GameObject> ProduceObjects()
{
if (this.CanShoot)
{
this.CanShoot = false;
int col = this.topLeft.Col + (this.Width / 2);
var bulletTopLeft = new MatrixCoords(this.topLeft.Row, col);
var bullet = new Bullet(bulletTopLeft);
return new GameObject[] { bullet };
}
return base.ProduceObjects();
}
开发者ID:razsilev,项目名称:TelerikAcademy_Homework,代码行数:15,代码来源:ShootingRacket.cs
示例15: GetBlock
public static Block GetBlock(int type, MatrixCoords coords)
{
switch (type)
{
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
return new Block(coords);
case 7:
return new UnpassableBlock(coords);
case 8:
return new GiftBlock(coords);
case 9:
return new ExplodingBlock(coords);
default:
return new Block(coords);
}
}
开发者ID:ilkodzhambazov,项目名称:Telerik-Academy,代码行数:21,代码来源:BlockFactory.cs
示例16: ProduceObjects
public override IEnumerable<GameObject> ProduceObjects()
{
List<GameObject> produced = new List<GameObject>();
MatrixCoords speed = new MatrixCoords(0, 0);
if (this.IsDestroyed)
{
//upper
for (int col = -1; col <= 1; col++)
{
MatrixCoords tempTopLeft = new MatrixCoords(this.topLeft.Row - 1, this.topLeft.Col + col);
ExplosionUnit unit = new ExplosionUnit(tempTopLeft, speed);
produced.Add(unit);
}
//lower
for (int col = -1; col <= 1; col++)
{
MatrixCoords tempTopLeft = new MatrixCoords(this.topLeft.Row + 1, this.topLeft.Col + col);
ExplosionUnit unit = new ExplosionUnit(tempTopLeft, speed);
produced.Add(unit);
}
//left
MatrixCoords leftTopLeft = new MatrixCoords(this.topLeft.Row, this.topLeft.Col - 1);
ExplosionUnit leftUnit = new ExplosionUnit(leftTopLeft, speed);
produced.Add(leftUnit);
//right
MatrixCoords rightTopLeft = new MatrixCoords(this.topLeft.Row, this.topLeft.Col + 1);
ExplosionUnit rightUnit = new ExplosionUnit(rightTopLeft, speed);
produced.Add(rightUnit);
}
return produced;
}
开发者ID:Varbanov,项目名称:TelerikAcademy,代码行数:36,代码来源:ExplodingBlock.cs
示例17: Shrapnel
public Shrapnel(MatrixCoords topLeft, MatrixCoords speed)
: base(topLeft,new char[,] {{'^'}}, speed)
{
}
开发者ID:NikolovNikolay,项目名称:Telerik-Homeworks,代码行数:4,代码来源:Shrapnel.cs
示例18: IndestructibleBlock
public IndestructibleBlock(MatrixCoords upperLeft)
: base(upperLeft)
{
this.body[0, 0] = IndestructibleBlock.Symbol;
}
开发者ID:Jarolim,项目名称:AllMyHomeworkForTelerikAcademy,代码行数:5,代码来源:IndestructibleBlock.cs
示例19: ShootingRacket
public ShootingRacket(MatrixCoords topLeft, int width)
: base(topLeft,width)
{
}
开发者ID:NikolovNikolay,项目名称:Telerik-Homeworks,代码行数:4,代码来源:ShootingRacket.cs
示例20: TrailObject
public TrailObject(MatrixCoords topLeft, int lifetime)
: base(topLeft,new char[,]{{'.'}})
{
this.Lifetime = lifetime;
}
开发者ID:veselaparvanova,项目名称:TelerikAcademy-1,代码行数:5,代码来源:TrailObject.cs
注:本文中的AcademyPopcorn.MatrixCoords类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论