The book of inspiration

August 31, 2009

Delaunay triangulation

Filed under: jsc — Tags: , , , , — zproxy @ 6:28 am

There is a new example in town and it is about Delaunay triangulation. The original java source code can be found here.

DelaunayExample

source

With this example I had to add a significant bit of awt and swing classes to ScriptCoreLibJava which ofcourse will deem helpful once it is time to start implementing Windows Forms for java.

PS. Did you know? javax.swing.plaf stands for platform look and feel :)

Problems at porting which should be fixed in the future versions:

  • C# won’t allow nested classes in interface. Workaround is to use “sattelite” nesting parent class.
  • Calling base method from a virtual method seems to be broken and will cause stack overflow. fixed
  • The is operator in if expression was missing parenthesis. Workaround is to use local variable.
  • The boolean comparision in if expression should be optimized. Workaround is to use local variable.

June 18, 2009

new example: ExposedFunctions

Filed under: jsc — Tags: — zproxy @ 8:28 pm

I have prepared an example to demonstrate how to expose your C# coded function for scripting.

ExposedFunctions

Read the commented source code of that project for better understanding.

The short anwser to the problem looks like this:

31 [Script(NoDecoration = true)]

32 public static void ExposedFunctions_AddData1(Data1 e)

June 10, 2009

The Cloud Effect

Filed under: jsc — Tags: , , , — zproxy @ 2:15 pm

This example is a port of CloudEffect.



May 2, 2008

Shoot that sheep!

Filed under: jsc — Tags: , , , , , , — zproxy @ 3:04 pm

This is a simple game written with in c# with jsc for flash. It includes Mochiads. Developers can download this example project here (includes .dll and generated .as files) or just browse the source here.

FlashTowerDefense1

You are in the command of a machine gun tower and you are raided by mad sheep and enemy warriors. Your mission is to shoot them down.

  • Size: 320×240
  • Category: Shooting
  • Tags: machingun, sheep, blood
  • Content Rating: Everyone

Instructions: Aim at the enemy unit and hold down the mouse until the unit is terminated by gunfire.

March 16, 2008

jsc:actionscript now with anonymous types

Filed under: jsc — Tags: , , , — zproxy @ 1:05 pm

I was able to update jsc and now it supports anonymous types for projects targeting actionscript.

Starting today you can now use syntax like this:

    var query = from i in __users

                where i.ToLower().Contains(user_filter)

                let name = i.Trim()

                let isspecial = i.ToLower().Contains(user_filter2)

                select new { isspecial, length = name.Length, name };

Download latest jsc here.

For feature comparison between projects that target javascript and actionscript see those examples:





March 10, 2008

jsc status in march 2008

Filed under: jsc — Tags: , , , , , — zproxy @ 6:53 pm

I was hoping to release an update on jsc but it did not work out as i thought, thus i figured it would be great to just gather the downloadable bits in one post for those of you who are new to jsc. Just so you know I am working on a flash game (getting to know flash) :)

Things you could do:

  1. Download jsc dated 2008 02 10
  2. Download jsc example projects dated 2007 12 31
  3. See the examples live and comment at zproxy.wordpress.com
  4. See the tycoon look alike
  5. Read the tutorial for NatureBoyTestPad project
  6. Discuss jsc at google groups
  7. Visit jsc.sf.net
  8. Subscribe to this blog :)
  9. Write the next killer javascript/actionscript web application in c# :)

February 10, 2008

C# To ActionScript, Initial LINQ Support

Filed under: jsc — Tags: , , , , , — zproxy @ 5:18 pm

I am introducing LINQ for ActionScript – you can now start writing your flash applications in c# using linq and convert it to actionscript via jsc compiler.

How does the generated code compare to the original

In c# the code looks like this:

foreach (var v in from i in __users

where i.Trim().ToLower().Contains(user_filter)

select i.Trim())

{

result.text += “result: “ + v + “\n”;

}

The generated ActionScript looks like this:

enumerator_15 = __Enumerable.Select_100663437(__Enumerable.Where_100663439(SZArrayEnumerator_1.op_Implicit_100664110(__users), new __Func_2(CS___8__locals15, __IntPtr.op_Explicit_100665307(“__ctor_b__8_100663306″))), FlashLinqToObjects___c__DisplayClassf.CS___9__CachedAnonymousMethodDelegate13).GetEnumerator_100664907();

try

{

while (enumerator_15.MoveNext_100665359())

{

v = enumerator_15.get_Current_100665499();

this.result.text = this.result.text+ “result: “+ v+ “\x0a”;

}

}

finally

{

if (!(enumerator_15 == null))

{

enumerator_15.Dispose_100665605();

}

}

New example project:



Download latest the jsc version here.

January 13, 2008

C# to ActionScript, MySoundDemo

Filed under: jsc — Tags: , , , — zproxy @ 1:14 pm

New example is out and new version of jsc too.

Download jsc (c# to javascript)



January 12, 2008

c# to actionscript

Filed under: jsc — Tags: , , , — zproxy @ 6:50 pm

After a long time we now present you c# to actionscript compiler. It is work in progrss, but you can have a sneak peak now :)

The concept is that you write c# code in visual studio 2008 or later, let jsc translate your dll or exe to actionscript source code and then let the mxmlc compiler do the final work. Simple, right? :)

MyWebCamera



January 1, 2008

tutorial: NatureBoyTestPad

Filed under: jsc — Tags: , , , , — zproxy @ 7:54 pm


A tutorial how to create such an application can be found here.

December 31, 2007

Javascript Tycoon 2007

Filed under: jsc — Tags: , , , — zproxy @ 6:44 pm

Well, it is the end of the year and I wanted to get as much done as possible with the javascript tycoon. I managed to add some road construction tools :)

Play it in your browser. Vote for it at tt forums. Look at the c# source code. Try jsc yourself.

jsty3scr

December 27, 2007

try javascript tycoon within youOS

Filed under: jsc — Tags: , , , , — zproxy @ 9:16 am

You now can install javascript tycoon and javascript worm game inside youOS desktop.

View javascript tycoon directly. Vote for it.

View javascript tycoon as a youOS guest.

View javascript worm game as a youOS guest.

Ingame video:

My developer page is not up to date, but it should list all applications I have prepared for youOS. If you like those applications, rate the, this way my developer avatar gets a higher ranking on the scoreboard page.

If you just happen to want to play transport tycoon I would suggest you to visit openttd.org .
If you’d like to create something similar then get jsc and start coding.

The Shocking Blue Green Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 76 other followers