This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Xna.Framework; | |
using ZoomEngine.Animation; | |
namespace Game | |
{ | |
public class Camera | |
{ | |
private ClockManager _clockManager; | |
// position of the camera |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class FlyCamera : MonoBehaviour { | |
/* | |
Writen by Windexglow 11-13-10. Use it, edit it, steal it I don't care. | |
Converted to C# 27-02-13 - no credit wanted. | |
Simple flycam I made, since I couldn't find any others made public. | |
Made simple to use (drag and drop, done) for regular keyboard layout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##################################################################################################### | |
# 2019-01-15 Initial Creation | |
# 2019-04-01 Added ReSharper Settings | |
# 2019-05-16 Naming Rules Work With ReSharper | |
# 2019-07-09 Constant and Static Readonly Naming Rules | |
# 2022-09-16 New Settings for Visual Studio 2022 | |
##################################################################################################### | |
# Based off of generic config from https://github.com/RehanSaeed/EditorConfig | |
# License MIT - https://github.com/RehanSaeed/EditorConfig/blob/master/LICENSE | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Xml.Linq; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
namespace DotSettingsConverter | |
{ | |
[TestClass] | |
public class DotSettingsConverterTest | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let exploreState = { | |
execute: function(player,warrior) { | |
if (player.sense(warrior) === 'empty') { | |
warrior.walk(player.direction); | |
} | |
else if (player.sense(warrior) === 'wall') { | |
warrior.pivot(); | |
} | |
else if (player.sense(warrior) === 'enemy') { | |
warrior.think("It's time to kick ass and chew bubble gum..."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Program | |
{ | |
private static double DistanceBetween( int x1, int y1, int x2, int y2 ) | |
{ | |
return Math.Sqrt( Math.Pow( x2 - x1, 2 ) + Math.Pow( y2 - y1, 2 ) ); | |
} | |
private static int WalkingDistanceBetween( int x1, int y1, int x2, int y2 ) | |
{ | |
return Math.Abs( x2 - x1 ) + Math.Abs( y2 - y1 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Text.RegularExpressions; | |
using System.Xml; | |
using System.Xml.Linq; | |
namespace Formix.Utils | |
{ | |
class Program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Draw everything that will be transformed with the camera like the player, cells, etc. | |
_spriteBatch.Begin( SpriteSortMode.BackToFront, null, SamplerState.PointClamp, null, null, null, Camera.TranslationMatrix ); | |
for ( int x = minX; x < maxX; x++ ) | |
{ | |
for ( int y = minY; y < maxY; y++ ) | |
{ | |
bool isVisible = Global.GameModel.Map.Properties[x + y * Global.GameModel.Map.Width] == CellProperties.Visible; | |
Tiles[x, y].Draw( _spriteBatch, SpriteSheet, new Vector2( x * Global.CellWidth, y * Global.CellHeight ), isVisible ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Create new table for keeping track of all the versions of project files | |
CREATE TABLE wa.ProjectVersion( | |
ProjectVersionId int IDENTITY(1,1) NOT NULL, | |
ProjectId int NOT NULL, | |
DateCreated datetime2(7) NOT NULL, | |
ProjectFileId varchar(50) NOT NULL | |
PRIMARY KEY CLUSTERED | |
( | |
ProjectVersionId ASC | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class EnumExtensions | |
{ | |
private static void CheckIsEnum<T>(bool withFlags) | |
{ | |
if (!typeof(T).IsEnum) | |
throw new ArgumentException(string.Format("Type '{0}' is not an enum", typeof(T).FullName)); | |
if (withFlags && !Attribute.IsDefined(typeof(T), typeof(FlagsAttribute))) | |
throw new ArgumentException(string.Format("Type '{0}' doesn't have the 'Flags' attribute", typeof(T).FullName)); | |
} |
NewerOlder