HelloWorld in T2D.NET
by Jason Swearingen · in Torque Game Builder · 12/10/2005 (9:46 pm) · 2 replies
// code written in C#
namespace TAO
{
static class Program
{
[System.STAThread]
static void Main()
{
TAO.World.Run(runThis);
}
public static void runThis()
{
TAO.StaticSprite mySprite = new StaticSprite();
mySprite.Picture.ImageMap = "resources.net/images/helloWorld";
mySprite.Picture.ShowDebug(World.DebugFlags.All);
mySprite.location.Area = new Rectangle(-10.2f, -3f, 14.9999f, 22f);
mySprite.movement.constantForce.Set(new PolarVector(122.22f, 32));
mySprite.worldLimit.Set(TAO.Internal.SceneObject.LimitMode.BOUNCE, new Rectangle(-45, -30, 45, 30));
mySprite.movement.AutoRotation = 40;
}
}
}Not much code to, pretty easy to read, and does exactly what it looks like it does.

This was done using a new abstraction layer I'm writing (i call it "Torque Abstraction Objects" (TAO2D)). TAO2D is only about 25% done, but it sits on top of my (already complete) T2D.NET Code.
Hope to be able to share this soon, but it's a lot of work for 1 person, so be patient. :)
#2
I am considering removing the dependancy on the default scripts, but right now that's pretty low on my priorities (not much bang-for-the-buck)
-Jason
12/12/2005 (11:44 am)
I am currently using the default scripts (the stuff that's auto installed to example/T2D) but the developer never has to think about that, it's good to keep around for torquescript interop (you can use .net side-by-side with torquescript) but that's it.I am considering removing the dependancy on the default scripts, but right now that's pretty low on my priorities (not much bang-for-the-buck)
-Jason
Torque Owner Adam Johnston
but is this ALL the code necesary to launch T2D in your demo?
I mean there is no necessity of the common, T2D dirs and aaaaall the
underlying cs scripts?
If so its terrific u know...