本文整理汇总了C#中Models.getParticleSystem方法的典型用法代码示例。如果您正苦于以下问题:C# Models.getParticleSystem方法的具体用法?C# Models.getParticleSystem怎么用?C# Models.getParticleSystem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Models
的用法示例。
在下文中一共展示了Models.getParticleSystem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: handleProjectileCollisions
public void handleProjectileCollisions(Models.Gameworld gameWorld)
{
List<int> rockCollisionsIndex = physicsEngine.RockCollisionIndexes;
List<int> enemyCollisionsIndex = physicsEngine.EnemyCollisionIndexes;
List<Models.GameObject> rockProjectileCollisions = physicsEngine.getRockProjectileCollisions();
List<Models.GameObject> enemyProjectileCollisions = physicsEngine.getEnemyProjectileCollisions();
Models.Projectile projectile = null;
int damage;
if (rockProjectileCollisions.Count != 0)
{
for (int i = 0; i < rockProjectileCollisions.Count; i++)
{
projectile = (Models.Projectile)rockProjectileCollisions[i++];
damage = projectile.Damage;
rockProjectileCollisions[i].updateCurrentHealth(- damage);
spawnExplosionParticles(projectile, projectile, gameWorld.getParticleSystem());
physicsEngine.collisionUsingAllKindaCrazyStuff(rockProjectileCollisions[i], projectile);
}
for (int i = 0; i < rockCollisionsIndex.Count; i++)
{
if (gameWorld.getRock()[rockCollisionsIndex[i]].CurrentHealth <= 0)
{
spawnExplosionParticles(gameWorld.getRock()[rockCollisionsIndex[i]], projectile, gameWorld.getParticleSystem());
soundManager.playSoundWithPositioning("explosion", gameWorld.PlayerObject, gameWorld.getRock()[rockCollisionsIndex[i]]);
gameWorld.getRock().RemoveAt(rockCollisionsIndex[i]);
}
}
}
if(enemyProjectileCollisions.Count != 0)
{
for (int i = 0; i < enemyProjectileCollisions.Count; i++)
{
projectile = (Models.Projectile)enemyProjectileCollisions[i];
i++;
damage = projectile.Damage;
enemyProjectileCollisions[i].updateCurrentHealth(-damage);
spawnExplosionParticles(projectile, projectile, gameWorld.getParticleSystem());
}
for (int i = enemyCollisionsIndex.Count -1; i >= 0; i--)
{
if (gameWorld.EnemyList[enemyCollisionsIndex[i]].CurrentHealth <= 0)
{
spawnExplosionParticles(gameWorld.EnemyList[enemyCollisionsIndex[i]], projectile, gameWorld.getParticleSystem());
soundManager.playSoundWithPositioning("explosion", gameWorld.PlayerObject, gameWorld.EnemyList[enemyCollisionsIndex[i]]);
gameWorld.Score += gameWorld.EnemyList[enemyCollisionsIndex[i]].MaxHealth;
gameWorld.EnemyList.RemoveAt(enemyCollisionsIndex[i]);
}
}
}
}