本文整理汇总了C#中TileCollision类的典型用法代码示例。如果您正苦于以下问题:C# TileCollision类的具体用法?C# TileCollision怎么用?C# TileCollision使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TileCollision类属于命名空间,在下文中一共展示了TileCollision类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MovableTile
public MovableTile(Level level, Vector2 position, TileCollision collision)
{
this.level = level;
this.position = position;
this.collision = collision;
LoadContent();
}
示例2: TileTODO
//public static readonly Vector2 Size = new Vector2(Width, Height);
/// <summary>
/// Constructs a new tile.
/// </summary>
public TileTODO(Texture2D texture, TileCollision collision)
{
Width = texture.Width;
Height = texture.Height;
Texture = texture;
Collision = collision;
}
示例3: MoveableTile
/// <summary>
/// Creates a new Moveable tile.
/// </summary>
/// <param name="sprite">Sprite representing texture, size, and position of the tile. </param>
/// <param name="collision">Type of collision for the tile.</param>
/// <param name="velocity">Tile velocity: .X is the movement angle in radians and .Y is the speed in pixels per second.</param>
public MoveableTile(Sprite sprite, TileCollision collision, Vector2 velocity)
: base(sprite, collision)
{
this.velocity = velocity;
Leader = this; // By default, tiles lead themselves
}
示例4: Tile
public Tile(string tileName, Texture texture, TileCollision tileCollision, Vector position)
{
TileName = tileName;
TileCollision = tileCollision;
Sprite.Texture = texture;
Sprite.SetPosition(position);
}
示例5: Tile
/// <summary>
/// Constructs a new tile.
/// </summary>
public Tile(Sprite sprite, TileCollision collision)
{
if (sprite != null)
Sprite = sprite;
else
Sprite = new Sprite();
Collision = collision;
}
示例6: MovableTile
public MovableTile(Level level, Vector2 position, TileCollision collision , Boolean SmashBlock)
{
this.level = level;
this.position = position;
this.collision = collision;
this.isSmashBlock = SmashBlock;
LoadContent();
}
示例7: Tile
public Tile(Texture2D texture, TileCollision collision, Rectangle bounds, Vector2 position)
{
this.texture = texture;
this.tileType = collision;
this.bounds = bounds;
this.position = position;
this.pathfindingParm = new AstarParam();
}
示例8: LadderTile
/// <summary>
/// Constructor defaulting to inactive ladder
/// </summary>
/// <param name="sprite"></param>
/// <param name="collision"></param>
public LadderTile(Sprite sprite, TileCollision collision)
: base(sprite, collision)
{
activated = sprite.Texture;
deactivated = null;
isActive = false;
this.Sprite = sprite;
}
示例9: Tile
public Tile(PyramidPanic game,string tileName
,Vector2 position,TileCollision tileCollision,char charItem)
{
this.game = game;
this.tileCollision = tileCollision;
this.texture = game.Content.Load<Texture2D>(@"PlaySceneAssets\tiles\"+tileName);
this.position = position;
this.rectangle = new Rectangle((int)this.position.X, (int)this.position.Y, texture.Width, texture.Height);
this.charItem = charItem;
}
示例10: MovingBlock
//Constructor
public MovingBlock(PyramidPanic game, string blockName, Vector2 location,
TileCollision blockCollision, char charItem )
{
this.game = game;
this.texture = this.game.Content.Load<Texture2D>(@"PlaySceneAssets\pushable\" + blockName);
//this.colText = this.game.Content.Load<Texture2D>(@"PlaySceneAssets\Explorer\CollisionText");
this.startLocation = location;
this.Location = location;
this.state = new MovingBlockIdle(this);
}
示例11: Platform
public Platform(Rectangle platformBounds,TileCollision collision, Boolean isShadowCaster, KryptonEngine krypton)
{
this.krypton = krypton;
Collision = collision;
IsShadowCaster = isShadowCaster;
Bounds = platformBounds;
if (isShadowCaster)
{
ShadowHull shadowHull = ShadowHull.CreateRectangle(new Vector2(platformBounds.Width, platformBounds.Height));
shadowHull.Position.X = platformBounds.X + platformBounds.Width/2;
shadowHull.Position.Y = platformBounds.Y + platformBounds.Height/2;
krypton.Hulls.Add(shadowHull);
}
}
示例12: Tile
/// <summary>
/// Constructs a new tile.
/// </summary>
public Tile(int texture)
{
Texture = texture;
if (texture < 6)
{
Collision = TileCollision.Passable;
}
else if (texture < 99)
{
Collision = TileCollision.Platform;
}
else
{
Collision = TileCollision.LevelExit;
}
}
示例13: Tile
public Tile(TileType typeIn, int xIn, int yIn, int totalWidthIn, int totalHeightIn, Random rand, TileCollision collision, int decoration = -1)
{
tileType = typeIn;
size.X = size.Y = 16;
position = new Vector2(xIn * size.X, yIn * size.Y);
render = true;
decorationValue = decoration;
tileOrientation = TileOrientation.Regular;
totalHeight = totalHeightIn;
totalWidth = totalWidthIn;
tileCollision = collision;
if (tileType == TileType.Dirt)
{
hitsRequired = 1;
if (rand.Next(1, 25) == 5)
{
//damage = rand.Next(1, 3);
// health = damage * 30;
}
}
else if (tileType == TileType.Metal)
hitsRequired = 5;
}
示例14: LoadTile
/// <summary>
/// Creates a new tile. The other tile loading methods typically chain to this
/// method after performing their special logic.
/// </summary>
/// <param name="name">
/// Path to a tile texture relative to the Content/Tiles directory.
/// </param>
/// <param name="collision">
/// The tile collision type for the new tile.
/// </param>
/// <returns>The new tile.</returns>
private Tile LoadTile(string name, TileCollision collision)
{
return new Tile(Content.Load<Texture2D>("Tiles/" + name), collision);
}
示例15: LoadEnviornmentTile
private Tile LoadEnviornmentTile(string tileNameInput, int variationCount, TileCollision collisionInput)
{
int index = random.Next(variationCount);
return LoadTile(tileNameInput + index, collisionInput);
}