- DelphiTools - https://www.delphitools.info -

DWS news + OP4JS aka SmartMobileStudio

A quick news roundup before Christmas.

OP4JS Alpha aka SmartMobileStudio is in the wild

Jørn Einar Angeltveit  –  Dec 21, 2011  –  Public [1]

We’ve now sent “Smart Mobile Studio” Alpha version to 50 testers.

Did you miss the beta invite?

Visit www.SmartMobileStudio.com [2] to participate.

SmartMobileStudio leverages DWScript’s JavaScript CodeGen.

My first test app with the alpha was a clock, check it in your iOS or Android Browser [3] or in the Android market [4]. Source is included in the alpha. Will be beautified it later on 🙂

I’ve been playing on another one, head over to YouTube to see a small video [5], you can also get the apk [6] (47 kB), but beware it’s basic, ugly, and definitely early alpha, but it’s coded in Pascal!

Below is a snippet of the source code (using DWS inline implementations for illustration and compactness purposes, most of OP4JS is written in the more classic interface/implementation style), it’s a snip of the root class of the mini-engine of the game (yes, virtual methods are supported):

   TEntity = class
      X, Y : Float;

      function Progress : Boolean; virtual;
         // does nothing by default

      constructor Create(aX, aY : Float);
         X := aX;
         Y := aY;

      function Dist2(entity : TEntity) : Float;
         Result := Sqr(X-entity.X)+Sqr(Y-entity.Y);

Other recent changes to the DWScript SVN