本文整理汇总了C#中Levels类的典型用法代码示例。如果您正苦于以下问题:C# Levels类的具体用法?C# Levels怎么用?C# Levels使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Levels类属于命名空间,在下文中一共展示了Levels类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GameplayScreen
public GameplayScreen(Game1 game, Vector2 worldSize, Levels currentLevel)
: base(game)
{
this.worldSize = worldSize;
eCurrentLevel = currentLevel;
heatmapWriteTimer = 0;
//Make the tree a bit wider for outer walls.
quadTree = new QuadTree(new Rectangle(
-10, -10, (int)worldSize.X + 20, (int)worldSize.Y + 20));
//Add the 4 walls on the outside of the world.
Components.Add(new Wall(GDGame, new Vector2(-10, -10), new Vector2(worldSize.X + 10, 0)));
Components.Add(new Wall(GDGame, new Vector2(worldSize.X, -10), new Vector2(worldSize.X + 10, worldSize.Y)));
Components.Add(new Wall(GDGame, new Vector2(0, worldSize.Y), new Vector2(worldSize.X + 10, worldSize.Y + 10)));
Components.Add(new Wall(GDGame, new Vector2(-10, 0), new Vector2(0, worldSize.Y + 10)));
//Add the player to world.
Components.Add(Player = new PlayerBall(GDGame, new Vector2(300, 300)));
//Give the camera the new world size.
GDGame.Camera.WorldSize = worldSize + new Vector2(0, 100);
gameOver = won = false;
GDGame.IsMouseVisible = false;
}
开发者ID:Whojoo,项目名称:Bubble-popper,代码行数:27,代码来源:GameplayScreen.cs
示例2: Write
protected override void Write(Levels level, DContext context, string url, int column, int lineNr, Func<string> messageBuilder)
{
if (level < Levels.Info)
return;
lineNr = Math.Max(0, lineNr);
column = Math.Max(0, column);
switch (level)
{
//case Levels.Info:
// log.LogMessage(messageBuilder());
// break;
case Levels.Info: //TODO: get LogMessage to work.
case Levels.Warning:
if (url != null)
log.LogWarning(null, null, null, url, lineNr, column, 0, 0, messageBuilder());
else
log.LogWarning(messageBuilder());
break;
case Levels.Error:
if (url != null)
log.LogError(null, null, null, url, lineNr, column, 0, 0, messageBuilder());
else
log.LogError(messageBuilder());
break;
}
}
开发者ID:Xtremrules,项目名称:dot42,代码行数:26,代码来源:CompilerService.cs
示例3: Write
/// <summary>
/// Record the given log entry if the level is sufficient.
/// </summary>
protected override void Write(Levels level, DContext context, string url, int column, int lineNr, Func<string> messageBuilder)
{
if (level < Levels.Error)
return;
outputPane.EnsureLoaded();
outputPane.LogLine(FormatLevel(level) + messageBuilder());
}
开发者ID:rfcclub,项目名称:dot42,代码行数:10,代码来源:OutputPaneLog.cs
示例4: Message
/* ----------------------------------------------------------------- */
///
/// constructor
///
/// Exception、およびその派生クラス(例外クラス)が引数に指定された
/// 場合、Message の内容は指定されたメッセージレベルによって異なる。
/// Info, Warn, Error, Fatal の場合は、指定された例外クラスの
/// Message のみとなる。Trace, Debug の場合は、それに加えて
/// 例外クラスの型名、およびスタックトレースも含まれる。
///
/* ----------------------------------------------------------------- */
public Message(Levels level, Exception e)
{
_level = level;
_time = System.DateTime.Now;
if (level == Levels.Trace || level == Levels.Debug) _message = e.ToString();
else _message = e.Message;
}
开发者ID:neojjang,项目名称:cubepdf,代码行数:18,代码来源:Message.cs
示例5: LevelManager
public LevelManager( Levels startingLevel, Level levelObj)
{
m_levelDictionary = new Dictionary<Levels,Level>();
m_currentLevel = startingLevel;
m_levelDictionary.Add( Levels.JungTown, levelObj );
}
开发者ID:BoyuanZhang,项目名称:monogame_sword,代码行数:7,代码来源:LevelManager.cs
示例6: Awake
private Levels levels; // Reference to levels script
void Awake()
{
camera_script = GameObject.FindGameObjectWithTag(Tags.main_cam).GetComponent<CameraSetup>();
levels = GetComponent<Levels>();
brick_array = new GameObject[20, 20];
max_types = 2;
}
开发者ID:the-ivan,项目名称:old-unity-project-neon-breakout,代码行数:9,代码来源:Grid.cs
示例7: onHit
public override void onHit(Levels.Level l)
{
OffsetY -= 5;
HitSound.Play();
if (HeldItem != null)
{
l.Items.Add(HeldItem);
l.ParticleSystems.Add(new Particles.ParticleSystemCoin(Position.X, Position.Y));
coins--;
if(coins == 0)
HeldItem = null;
}
if(coins == 0)
{
SolidBlock temp = new SolidBlock(Position.X / 24, Position.Y / 24);
temp.OffsetY -= 5;
l.Blocks.Add(temp);
this.destroy(l);
}
}
开发者ID:JohnP42,项目名称:super-luigi,代码行数:25,代码来源:CoinBlock.cs
示例8: CheckShip
// Checks collision of the given object against the edges of the level
public void CheckShip(Object toCheck, Levels.SpaceLevel level)
{
bool currentHit = false;
Vector2 translationVector, centerDiff;
translationVector = Vector2.Zero;
centerDiff = new Vector2(level.GetLevelWidth() - toCheck.GetCenter().X, level.GetLevelHeight() - toCheck.GetCenter().Y);
if (CheckIntersection(toCheck.collisionPolygons, level.collisionPolygons, centerDiff, ref translationVector, true))
{
toCheck.SetPosition(new Vector2(toCheck.GetPosition().X + translationVector.X, toCheck.GetPosition().Y + translationVector.Y));
currentHit = true; ;
}
if (!currentHit)
{
//If they are not currently intersecting, check if they will intersect
Vector2 oldPosition1 = toCheck.GetPosition();
toCheck.SetPosition(new Vector2(oldPosition1.X + toCheck.Velocity.X, oldPosition1.Y + toCheck.Velocity.Y));
bool futureRet = CheckIntersection(toCheck.collisionPolygons, level.collisionPolygons, centerDiff, ref translationVector, true);
if (futureRet)
{
// Set the position back now that the future collision has been checked
toCheck.SetPosition(oldPosition1);
currentHit = true;
}
}
if (currentHit)
{
float speed = toCheck.Velocity.Length();
toCheck.Velocity = Vector2.Normalize(translationVector);
toCheck.Velocity *= speed;
}
}
开发者ID:RandomCache,项目名称:LightningBug,代码行数:34,代码来源:Collision.cs
示例9: Write
protected override void Write(Levels level, DContext context, string url, int column, int lineNr, string msg, Exception exception, object[] args)
{
if (level < Levels.Warning)
return;
if ((msg == null) && (exception != null)) msg = exception.Message;
if (msg == null)
return;
lineNr = Math.Max(0, lineNr);
column = Math.Max(0, column);
switch (level)
{
case Levels.Warning:
if (url != null)
log.LogWarning(null, null, null, url, lineNr, column, 0, 0, msg, args);
else
log.LogWarning(msg, args);
break;
case Levels.Error:
if (url != null)
log.LogError(null, null, null, url, lineNr, column, 0, 0, msg, args);
else
log.LogError(msg, args);
break;
}
}
开发者ID:rfcclub,项目名称:dot42,代码行数:25,代码来源:CompilerService.cs
示例10: Awake
private string level_name; // Custom level name
// TODO: custom level names regex check for invalid chars
void Awake ()
{
camera_script = GameObject.FindGameObjectWithTag(Tags.main_cam).GetComponent<CameraSetup>();
level_builder_script = GameObject.FindGameObjectWithTag(Tags.game_manager).GetComponent<LevelBuilder>();
grid_script = GameObject.FindGameObjectWithTag(Tags.game_manager).GetComponent<Grid>();
levels_script = GameObject.FindGameObjectWithTag(Tags.game_manager).GetComponent<Levels>();
}
开发者ID:the-ivan,项目名称:old-unity-project-neon-breakout,代码行数:10,代码来源:LevelEditor.cs
示例11: Log
/// <summary>
/// Logs the specified message.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="exception">The exception.</param>
private static void Log(Levels level, object message, Exception exception) {
string msg = message == null ? string.Empty : message.ToString();
if(exception != null) {
msg += ", Exception: " + exception.Message;
}
_logs.Add(new KeyValuePair<Levels, string>(level, msg));
}
开发者ID:BilliamBrown,项目名称:ServiceStack,代码行数:12,代码来源:TestLogger.cs
示例12: SetMyProperties
protected override void SetMyProperties()
{
myFirstName = properties.myFirstname;
health = properties.health;
timeBetweenShoot = properties.timeBetweenShoots;
initialForce = properties.initialForce;
level = Levels.Level2;
}
开发者ID:gujjugando,项目名称:CollegeTDProject,代码行数:8,代码来源:BombTower.cs
示例13: Result
private Result(Levels level, int? line, int? column, int? selectionStart, int? selectionLength, string message)
{
this._level = level;
this._line = line.HasValue ? line.Value : (int?)null;
this._column = column.HasValue ? column.Value : (int?)null;
this._selectionStart = selectionStart.HasValue ? selectionStart.Value : (int?)null;
this._selectionLength = selectionLength.HasValue ? selectionLength.Value : (int?)null;
this._message = (message == null) ? "" : message;
}
开发者ID:bgarrels,项目名称:betterpoeditor,代码行数:9,代码来源:Tidy.cs
示例14: MapLevels2Json
public LevelsJson MapLevels2Json(Levels json)
{
return new LevelsJson()
{
Beginner = json.Beginner,
Expert = json.Expert,
Intermediate = json.Intermediate
};
}
开发者ID:Quorning,项目名称:SpotFinder,代码行数:9,代码来源:MapSpot2Json.cs
示例15: CreateCode
public void CreateCode(Levels levels, System.IO.Stream stream)
{
foreach (Level nivel in levels)
{
string code;
nivel.Ordena();
code = nivel.ToString(Version.DameVersion(CPUVersion.CPC));
stream.Write(Encoding.UTF8.GetBytes(code), 0, Encoding.UTF8.GetByteCount(code));
}
}
开发者ID:AugustoRuiz,项目名称:UWOL,代码行数:10,代码来源:ZXCodeGenerator.cs
示例16: CreateCode
public void CreateCode(Levels levels, System.IO.Stream stream)
{
BinaryWriter writer = new BinaryWriter(stream);
for (int levelNum = 0; levelNum < levels.Count && levelNum < 41; levelNum++)
{
Level lvl = levels[levelNum];
byte nextByte;
nextByte = (byte)(((byte)lvl.TileFondo << 6) |
((byte)lvl.PaperColor << 3) |
((byte)lvl.InkColor));
writer.Write(nextByte);
int i = 0;
for (i = 0; i < lvl.Plataformas.Count; i++)
{
Plataforma plat = lvl.Plataformas[i];
nextByte = (byte)(((byte)plat.Longitud) << 4 | ((byte)plat.TipoPlataforma) << 1 | ((byte)plat.Direccion));
writer.Write(nextByte);
nextByte = (byte)(((byte)plat.X) << 4 | ((byte)plat.Y));
writer.Write(nextByte);
}
for (; i < Version.DameVersion(CPUVersion.ZX).MaxPlataformas; i++)
{
writer.Write((byte)0);
writer.Write((byte)0);
}
for (i = 0; i < lvl.Enemigos.Count; i++)
{
Enemigo enem = lvl.Enemigos[i];
nextByte = (byte)(((byte)enem.TileVert) << 4 | ((byte)enem.TipoEnemigo) << 1 | ((byte)enem.Velocidad));
writer.Write(nextByte);
nextByte = (byte)(((byte)enem.TileIzq) << 4 | ((byte)enem.TileDer));
writer.Write(nextByte);
}
for (; i < Version.DameVersion(CPUVersion.ZX).MaxEnemigos; i++)
{
writer.Write((byte)0);
writer.Write((byte)0);
}
for (i = 0; i < lvl.Monedas.Count; i++)
{
Moneda moneda = lvl.Monedas[i];
nextByte = (byte)(((byte)moneda.X) << 4 | ((byte)moneda.Y));
writer.Write(nextByte);
}
for (; i < Version.DameVersion(CPUVersion.ZX).MaxMonedas; i++)
{
writer.Write((byte)0);
}
}
}
开发者ID:AugustoRuiz,项目名称:UWOL,代码行数:55,代码来源:ZXbinCodeGenerator.cs
示例17: tiles
int xpos, ypos; //the location in tiles (xpos = column, ypos= row)
#endregion Fields
#region Constructors
//float movingTime = (0);
public PlayerCharacter(ContentManager myContent, SpriteBatch spriteBatch, int x, int y, Levels.Level currentLevel)
{
isMoving = false;
environment = currentLevel;
xpos = x;
ypos = y;
location = setlocation();
sprite = new Sprite("playercharacter", true, location, myContent, spriteBatch);
moveSpeed = ((float)environment.tileSize) / 24f;
}
开发者ID:Shnagenburg,项目名称:MegaActionBattleQuest,代码行数:18,代码来源:PlayerCharacter.cs
示例18: ScoreMenu
public ScoreMenu(Game1 game, float timeleft, int percentageBurned, int score, int collectables,
Levels nextLevel, Levels currentLevel)
: base(game, Keyboard.GetState(), GamePad.GetState(PlayerIndex.One))
{
this.totalTimeScore = timeleft * TimeScoreMod;
this.totalBurnScore = score;
this.percentageBurned = percentageBurned;
this.totalCollectableScore = collectables * CollectableScoreMod;
this.totalScore = this.totalTimeScore + this.totalBurnScore + this.totalCollectableScore;
this.currentLevel = currentLevel;
this.nextLevel = nextLevel;
}
开发者ID:Whojoo,项目名称:LittleFlame,代码行数:12,代码来源:ScoreMenu.cs
示例19: Header
/// <summary>
/// Initializes a new instance of the <see cref="Header"/> class.
/// </summary>
/// <param name="messageId">The message id.</param>
/// <param name="maxMessageSize">Size of the max message.</param>
/// <param name="securityLevel">The security level.</param>
/// <remarks>If you want an empty header, please use <see cref="Empty"/>.</remarks>
public Header(Integer32 messageId, Integer32 maxMessageSize, Levels securityLevel)
{
if (maxMessageSize == null)
{
throw new ArgumentNullException("maxMessageSize");
}
_messageId = messageId;
_maxSize = maxMessageSize;
SecurityLevel = securityLevel;
_flags = new OctetString(SecurityLevel);
_securityModel = DefaultSecurityModel;
}
开发者ID:bleissem,项目名称:sharpsnmplib,代码行数:20,代码来源:Header.cs
示例20: Room
public Room(Levels level, int id, RoomTypes type, Items item, int upRoomIndex, int straightRoomIndex, int downRoomIndex)
{
Level = level;
Id = id;
RoomType = type;
Item = item;
IsItemCollected = false;
RoomUpIndex = upRoomIndex;
RoomStraightIndex = straightRoomIndex;
RoomDownIndex = downRoomIndex;
_enemies = new List<IEnemy>();
}
开发者ID:poodull,项目名称:PinBrain,代码行数:13,代码来源:Room.cs
注:本文中的Levels类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论