本文整理汇总了C#中Platform.setBind方法的典型用法代码示例。如果您正苦于以下问题:C# Platform.setBind方法的具体用法?C# Platform.setBind怎么用?C# Platform.setBind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Platform
的用法示例。
在下文中一共展示了Platform.setBind方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateAll
//.........这里部分代码省略.........
r.resolveCollisionWithObject(collisionState, ninja);
}
else if (collisionState == 0)
{
r.setRotationAngle(0.0f);
}
r.Update(timeElapsed);
}*/
#region Items to WorldObjects
foreach (Item item in listOfWorldItems)
{
if (ninja.drawRect.Intersects(item.drawRect) && ninja.HeldItem == null && item.isUsed == false)
{
ninja.HeldItem = item;
ninja.HeldItem.isHeld = true;
}
if (!item.isUsed) continue;
//Check if item hits platform, and if so, then bind item to platform
foreach (Platform p in listOfWorldPlatforms)
{
collisionState = Collision.checkCollisions(p, item);
item.isHeld = false;
if (collisionState != 0)
{
item.setVelocity(0, 0);
item.setGravity(false);
switch (item.type)
{
case ItemType.Shuriken:
if(item.isBoundToAnotherPlatform == false) p.bindObject(item);
item.setBind();
item.isUsed = false;
break;
case ItemType.Sword:
Rectangle r = item.drawRect;
swordPlatform = new Platform(r, item.drawTex, false, false, false, false, false);
swordPlatform.drawStyle = WorldObjectDrawStyle.Rotating;
if (collisionState == 1) swordPlatform.rotationAngle = (float)(180*Item.radian);
else if (collisionState == 2) swordPlatform.rotationAngle = (float)(270* Item.radian);
else if(collisionState == 3) swordPlatform.rotationAngle = 0;
else if (collisionState == 4) swordPlatform.rotationAngle = (float)(90 * Item.radian);
removedItem = item;
if (!item.isBoundToAnotherPlatform) p.bindObject(swordPlatform);
swordPlatform.setBind();
swordToPlatform = true;
break;
}
item.platformCheck(p);
}
//Test collision between shuriken and rope
if (item.type == ItemType.Shuriken)
{
List<SuspendRope> ropes = p.suspendRopes;
for (int j = 0; j < ropes.Count; j++)
{
if (item.drawRect.Intersects(ropes[j].drawRect))
{
MusicManager.PlaySoundEffect(SoundEffects.cutRope);