예제 #1
0
        public override string GenerateTileDebugInfo(CollisionStatus status)
        {
            var sb = new StringBuilder();

            sb.AppendFormat("* Extension direction: {0}\n", DebugDrawUtils.ShowWithColor(ExtensionDirection, Colors.Yellow));
            return(sb.ToString());
        }
예제 #2
0
        public string GenerateCellDebugInfo(Tile tile)
        {
            var sb     = new StringBuilder();
            var status = _world.GetTileCollisions(tile);

            sb.AppendFormat("* Tile:            {0} ({1})\n", tile.Type, tile.GetType());
            sb.AppendFormat("* Name:            {0} (#{1})\n", tile.Name, tile.GetInstanceId());
            sb.AppendFormat("* Position:        {0}\n", tile.Position);
            sb.AppendFormat("* Rotation:        {0}\n", Mathf.Rad2Deg(tile.Rotation));
            sb.AppendFormat("* State:           {0}\n", tile.MoveState);
            sb.AppendFormat("* Last direction:  {0}\n", tile.LastDirection);
            sb.AppendFormat("* Priority:        {0}\n", tile.Priority);
            sb.AppendFormat("* Target position: {0}\n", tile.TargetPosition);
            sb.AppendFormat("* Target rotation: {0}\n", Mathf.Rad2Deg(tile.TargetRotation));
            sb.AppendFormat("* Cell Position:   {0}\n", _world.GetTileCurrentGridPosition(tile));
            sb.AppendFormat("* Tile layer:      {0}\n", DebugDrawUtils.ShowWithColor(tile.TileLayer, Colors.Yellow));
            sb.AppendFormat("* Direction:       {0}\n", DebugDrawUtils.ShowTileDirection(tile.NextDirection));
            sb.Append(GenerateCollisionDebugInfo(status));

            // Explosion info
            if (tile.CanExplode && tile.WillExplodeAtTick != -1)
            {
                sb.AppendFormat(
                    "{0} {1}\n",
                    DebugDrawUtils.ShowWithColor("* Will explode at tick: ", Colors.Red),
                    DebugDrawUtils.ShowWithColor(tile.WillExplodeAtTick + 1, Colors.Red)
                    );
            }

            sb.Append(tile.GenerateTileDebugInfo(status));
            return(sb.ToString());
        }
예제 #3
0
        public override string GenerateTileDebugInfo(CollisionStatus status)
        {
            var sb = new StringBuilder();

            sb.AppendFormat("* Can go up:    {0,-30} - Can push up:    {1,-30}\n", DebugDrawUtils.ShowBool(CanGoTowards(Direction.Up)), DebugDrawUtils.ShowBool(CanPushTowards(Direction.Up)));
            sb.AppendFormat("* Can go down:  {0,-30} - Can push down:  {1,-30}\n", DebugDrawUtils.ShowBool(CanGoTowards(Direction.Down)), DebugDrawUtils.ShowBool(CanPushTowards(Direction.Down)));
            sb.AppendFormat("* Can go left:  {0,-30} - Can push left:  {1,-30}\n", DebugDrawUtils.ShowBool(CanGoTowards(Direction.Left)), DebugDrawUtils.ShowBool(CanPushTowards(Direction.Left)));
            sb.AppendFormat("* Can go right: {0,-30} - Can push right: {1,-30}\n", DebugDrawUtils.ShowBool(CanGoTowards(Direction.Right)), DebugDrawUtils.ShowBool(CanPushTowards(Direction.Right)));
            return(sb.ToString());
        }
예제 #4
0
        public override string GenerateTileDebugInfo(CollisionStatus status)
        {
            var sb = new StringBuilder();

            sb.AppendFormat("* Last direction: {0}\n", DebugDrawUtils.ShowTileDirection(_lastDirection));
            sb.AppendFormat("* Can go up:      {0}\n", DebugDrawUtils.ShowBool(CanGoUp()));
            sb.AppendFormat("* Can push up:    {0}\n", DebugDrawUtils.ShowBool(CanPushUp()));
            sb.AppendFormat("* Can go down:    {0}\n", DebugDrawUtils.ShowBool(CanGoUp()));
            return(sb.ToString());
        }
예제 #5
0
        public string GenerateCollisionDebugInfo(CollisionStatus status)
        {
            var sb = new StringBuilder();

            sb.AppendFormat("* Collisions:\n");
            sb.AppendFormat("  {0,-33} {1,-33} {2,-33}\n", DebugDrawUtils.ShowCollisionTile(status.topLeft?.Type), DebugDrawUtils.ShowCollisionTile(status.top?.Type), DebugDrawUtils.ShowCollisionTile(status.topRight?.Type));
            sb.AppendFormat("  {0,-33} {1,-42}\n", DebugDrawUtils.ShowCollisionTile(status.left?.Type), DebugDrawUtils.ShowCollisionTile(status.right?.Type));
            sb.AppendFormat("  {0,-33} {1,-33} {2,-33}\n", DebugDrawUtils.ShowCollisionTile(status.bottomLeft?.Type), DebugDrawUtils.ShowCollisionTile(status.bottom?.Type), DebugDrawUtils.ShowCollisionTile(status.bottomRight?.Type));
            return(sb.ToString());
        }
예제 #6
0
        public override string GenerateTileDebugInfo(CollisionStatus status)
        {
            var sb = new StringBuilder();

            sb.AppendFormat("* Can go up:      {0}\n", DebugDrawUtils.ShowBool(CanGoUp()));
            sb.AppendFormat("* Can go down:    {0}\n", DebugDrawUtils.ShowBool(CanGoUp()));
            sb.AppendFormat("* Can roll left:  {0}\n", DebugDrawUtils.ShowBool(CanRollLeft()));
            sb.AppendFormat("* Can roll right: {0}\n", DebugDrawUtils.ShowBool(CanRollRight()));
            sb.AppendFormat("* Fall ticks:     {0}\n", DebugDrawUtils.ShowWithColor(_fallTicks, Colors.Yellow));
            return(sb.ToString());
        }
예제 #7
0
        private string GenerateInfoText()
        {
            var sb = new StringBuilder();

            sb.Append("[b]OpenTerra Debug Draw[/b]\n");
            sb.AppendFormat("* FPS: {0}\n", DebugDrawUtils.ShowFPS(Engine.GetFramesPerSecond()));
            sb.AppendFormat("* Simulation status: {0}\n", DebugDrawUtils.ShowBool(_world.Running));
            sb.AppendFormat("* Ticks elapsed: {0}\n", _world.GameTicks);
            sb.AppendFormat("* Seconds elapsed: {0}\n", _world.ElapsedTime);
            return(sb.ToString());
        }