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
... | |
private static void BindNative(IntPtr functionPtr, String name, String prototype) | |
{ | |
// Manual implementation of __fastcall. | |
// Moves the two first arguments to the registers, and pushes the rest on the stack. | |
var code = new byte[32]; | |
var stream = new MemoryStream(code); | |
var writer = new BinaryWriter(stream); |
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 abstract class ImplicitModuleBase | |
{ | |
public virtual Int32 Seed { get; set; } | |
public virtual Double Get(Double x, Double y) { return 0.00; } | |
public virtual Double Get(Double x, Double y, Double z) { return 0.00; } | |
public virtual Double Get(Double x, Double y, Double z, Double w) { return 0.00; } |
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
{ | |
"modules": [ | |
{ "type": "constant", "key": "tile_air", "value": "1" }, | |
{ "type": "constant", "key": "tile_dirt", "value": "2" }, | |
{ "type": "constant", "key": "tile_stone", "value": "3" }, | |
{ "type": "constant", "key": "tile_copper", "value": "4" }, | |
{ "type": "constant", "key": "tile_silver", "value": "5" }, | |
{ "type": "constant", "key": "tile_gold", "value": "6" }, | |
{ "type": "gradient", "key": "contour_gradient", "x0":"0.00", "x1":"0.00", "y0": "0.00", "y1": "1.00" }, |
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
<chain source="ground_select"> | |
<module type="constant" name="tile_air" value="1.00" /> | |
<module type="constant" name="tile_dirt" value="2.00" /> | |
<module type="constant" name="tile_stone" value="3.00" /> | |
<module type="constant" name="tile_copper" value="4.00" /> | |
<module type="constant" name="tile_silver" value="5.00" /> | |
<module type="constant" name="tile_gold" value="6.00" /> | |
<module type="constant" name="tile_bedrock" value="255.00" /> | |
<module type="gradient" name="contour_gradient" x0="0.00" x1="0.00" y0="0.00" y1="1.00" /> |
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
... | |
private Vector2 ApplyTileCollision(Vector2 deltaVelocity) | |
{ | |
var deltaPosition = this.Position + deltaVelocity; | |
// Reset active values, as they are recalculated. | |
this.ActiveFriction = Single.NaN; | |
this.ActiveElasticity = Single.NaN; | |
var startx = this.TileStartX - 1; |
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
Techno-magic is a setting where magic has been industrialized, and is used much like electricity is in our modern world. The difference | |
comes from the different magic types(power types), which rarely mix with good results, forcing a need to separate power conductors to keep | |
the various power types from mixing, though clever design may allow shared conductors. Power storage(batteries) also suffers from this, | |
forcing a different battery for each power type. Special converters exist that accept all types of power, but does so very inefficiently, | |
often sacrificing much of the potential energy in the conversion process. | |
Power types: | |
* Angelic/Good (visual:gold+effects) (damage:holy) | |
* Solar/Holy/Good (visual:gold) (damage:holy) (effect:extra good against undead/demonic creatures) | |
* Frost/Cold/Neutral (visual:blue) (damage:frost) (effect:slows down targets) |
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
Equipment | |
Tools | |
- Shovel, for harvesting sand, gravel, dirt and other soft materials. | |
* Pickaxe, for harvesting rocks and ores and other hard materials. | |
- Axe, for harvesting wood type materials. | |
* Crowbar, for havesting background tiles. | |
- Hoe, prepares dirt for sowing. | |
Weapons | |
* Sword |
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 EntityPhysicsSystem : GameComponent | |
{ | |
private readonly HashSet<Entity> entities; | |
public EntityPhysicsSystem(Game game, HashSet<Entity> entities) | |
: base(game) | |
{ | |
this.entities = entities; | |
} |
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; | |
namespace TinkerWorX.EntitySystemFramework | |
{ | |
public sealed class Entity | |
{ | |
private readonly Dictionary<Type, IComponent> components = new Dictionary<Type, IComponent>(); | |
public void Add(IComponent component) |
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
private void RunGame(bool useBlockingRun) | |
{ | |
try | |
{ | |
try | |
{ | |
this.graphicsDeviceManager = this.Services.GetService(typeof(IGraphicsDeviceManager)) as IGraphicsDeviceManager; | |
if (this.graphicsDeviceManager != null) | |
{ | |
this.graphicsDeviceManager.CreateDevice(); |