The book of inspiration

May 29, 2009

Using FLINT particle system from jsc

Filed under: jsc — Tags: , , , , , , — zproxy @ 6:00 pm
FLINT particle system

Moristar asked how to use an external libray from within a c# flash project. The short answer is yes you can, but you’d have to define stubs.

The long anwser…

In .net when you are talking to COM an interop assembly is used. The interop assembly defines types which represent the actual types to be used. That assembly is generated automatically at the time you reference the COM assembly.

It would be nice to be able to simply add a reference to a SWC file and use the features it defines, but currently it is not supported. A tool could be created which would read the SWC file and create the stub library. Currently this needs to be done manually.

Previous example

A year ago I did exactly this to get to use Google Maps with jsc. Today I updated its source to the latest Google Maps API version.

FlashGoogleMapsExample[source:svn]

In this post I am going to do this to demonstrate the same techniques for Flint and also comment on what I am doing.

(more…)

Advertisements

May 28, 2009

Android Developer Challenge

Filed under: life — Tags: , — zproxy @ 11:29 am

Timeline:

  • May 27 – Google I/O: ADC 2 announced
  • June: Full Terms and Conditions made available
  • Beginning in August: submission site opens, developers submit apps
  • Approximately 2 weeks later: submission site closes; ADC2 client/scoring app goes up on Market; users begin reviewing apps
  • Mid October: first-round judging ends
  • Mid November: final judging ends, winners announced

Categories:

  • Games: Casual/Puzzle
  • Games: Arcade/Action

For each of the 10 categories:

  • 1st prize: $100,000
  • 2nd prize: $50,000
  • 3rd prize: $25,000

Sounds cool? Where can I get the Android phone?

May 26, 2009

Code maturity

Filed under: life — Tags: , , , , — zproxy @ 11:22 am

A nice blog post for levels of making code work was brought to my attention. Here is a quick reminder cheatlist:

  1. Make it work
  2. Make it work well
  3. Make it work automatically
  4. Make it work invisibly

[…] “Good enough” is a programming concept that varies a lot from project to project, but overall it broadly fits into four categories.  Understand which one you’re aiming for and whether it might be useful to try to progress your code to a higher level of “Good enough”.

I have already posted about code quality earlier.

Update: A quoute from Proccessing.org:

The argument is not to avoid continually rewriting, but rather to delay engineering work until it’s appropriate

 

[…] That fact that the code performs it’s function is the first economic value of the code. But an equally large, and perhaps greater economic value (or cost) is how well another human can read and comprehend that code later on when managers decide to add pointless features or remove useful features.
Most code is written for economic reasons of some type. Writing code for another human to easily comprehend later increases the economic value of that code — possibly greatly. – http://developers.slashdot.org/story/14/01/21/1847217/code-is-not-literature

 

See also:

May 20, 2009

How to create a botnet

Filed under: life — Tags: — zproxy @ 8:06 am
  1. Wait for a new Operating System Release
  2. Add botnet code
  3. Distribute it via the internets
  4. ??
  5. Profit!!

I guess this will even work in 2016 when Windows 8 comes around…

Update: The Scrap Value of a Hacked PC

hackdpc.JPG

Update: Distributed Denial of Service – and how it works

original[2]

Update:

May 19, 2009

Fun and faith

Filed under: life — Tags: , , — zproxy @ 10:46 am

Ian at Gamasutra has compiled a list for game designers. Here are the key points I picked up for myself.

  1. Do play your game to ensure the fun
  2. Do keep design documentation up to date
  3. Do make prototypes with fun gameplay to remind the goals
  4. Do use placheolders
  5. Do use peer reviews
  6. Do play other games to learn from them, combine the ideas yet also use your own imagination
  7. Do add a good story in order to avoid tech demo status or just keep it simple and short

Have you also read this cool article – Bad Game Designer, No Twinkie! II?

But what makes a game actually fun or even worth playing? This is discussed by Mark at Gamasutra. Here is a summary for future reference.

  1. Do keep the player motivated to advance in your levels.
    1. Significant threat from behind will keep player moving
    2. A dangling carrot on the field ahead sure looks like an objective
    3. Impose a time limit for the player not to hang around
    4. Provide guidance or simply limit the possible routes the player can choose from
    5. Provide something of interest of the player to motivate him
    6. Use architectural pressure trigger movement via psychology including long corridors and junctions
    7. Taking away the object of interest will make him chase it down
  2. Make the player believe they are under a threat – actual danger.
    1. External – caused by an enemy
    2. Internal – caused by players mistakes
  3. Keep the player believing in an unknown danger which would build up tension – perceived danger.
  4. Tempo is described by the level of intensity of action.
    1. Explorative
    2. Puzzle
    3. Combat

Update:

http://www.ted.com/index.php/talks/lang/eng/dan_ariely_asks_are_we_in_control_of_our_own_decisions.html

Why are dumb hit points of any fun? A blog post over at rampantgames has the anwser.

  1. It is intuitive
  2. Players get a sense of a warning system
  3. It balances the game
  4. It is appealing to see the growth of hitpoints

May 18, 2009

5 Marketing Tips For Freelancers

Filed under: life — Tags: , — zproxy @ 3:36 pm

Scott at OPEN Forum has published the following tips

  1. Spend some time fixing up your address book
  2. Blog about side projects worth talking about
  3. Marketing your ideas and your own brand must also happen offline
  4. You need to market your greatest works in order to build your network and gain respect
  5. Create something that will differentiate your portfolio when the boom returns

May 15, 2009

URLRequestHeader

Filed under: jsc — Tags: , , — zproxy @ 8:35 am

The other day a developer named Carlo emailed me noted that currently URLRequestHeader is not exposed via ScriptCoreLib. In response to that I exposed those classes and created an example solution to demonstrate it. You would need to redownload jsc to get it ofcourse.

Before going into that I would like to show how one could add a native type that is not yet defined by other assemblies like ScriptCoreLib. In your assembly you would need to define a new type like this:

6 namespace ScriptCoreLib.ActionScript.flash.net

7 {

8 // http://livedocs.adobe.com/flex/3/langref/flash/net/URLRequestHeader.html

9 [Script(IsNative = true)]

10 public class URLRequestHeader

11 {

The compiler will later then assume that this type is provided by the platform itself or imported by some other means and use it as a native type.

The actionscript livedocs had a nice example which I translated to C#.

44 var loader = new URLLoader();

45

46 var header = new URLRequestHeader(“XMyHeader”, “got milk?”);

47

48 t.appendText(“\n” + this.loaderInfo.url);

49 t.appendText(“\nUsing relative path…”);

50

51 var request = new URLRequest(“../WebForm1.aspx”);

52 var data = new DynamicContainer { Subject = new URLVariables(“name=John+Doe”) };

53 data[“age”] = 23;

54

55 request.data = data.Subject;

56 request.method = URLRequestMethod.POST;

57 request.requestHeaders.push(header);

58

59 loader.complete +=

60 args =>

61 {

62 t.appendText(“\n” + loader.data);

63 };

64

65 loader.load(request);

In this demo I am sending three elements of data to the server:

  1. header XMyHeader
  2. post parameter name
  3. post parameter age

As we need a server to echo something back for us to see it works I added a new ASP.NET Web Application to the solution. The flash file generated by the jsc compiler will be copied to a folder Generated. The generated files are not included in the svn. This is why the solution will show exclamation marks on the first build.

headerserver

The WebForm1 implements the echo service like this:

10 public partial class WebForm1 : System.Web.UI.Page

11 {

12 protected void Page_Load(object sender, EventArgs e)

13 {

14 var data = new

15 {

16 XMyHeader = this.Request.Headers[“XMyHeader”],

17 name = this.Request.Params[“name”],

18 age = this.Request.Params[“age”],

19

20 };

21

22 this.Response.Write(“hi! “ + data.ToString());

23 this.Response.End();

24 this.Response.Close();

25 }

26 }

Running  it in the browser will give us the following view including the current URL and the text returned by the server.

headerhtml

The source code for this example is available here:

http://jsc.svn.sourceforge.net/viewvc/jsc/examples/actionscript/URLRequestHeaderExample/

As this is a dirty fast example – If anything needs clarification do let me know.

May 12, 2009

Are you a user or player?

Filed under: life — Tags: , — zproxy @ 7:40 pm

You can differentiate points to collectible points and deemable points. There is realtime feedback and feedback gathered over time both of which will thrive the player to a better level of mastery.

 

See also: Games kill depression

May 4, 2009

Designing Smart and Clever Applications

Filed under: life — Tags: — zproxy @ 5:16 am

Create a free website or blog at WordPress.com.