startshape realStart rule realStart { start { x 2 } } background { b -1 } rule start { terminal4 { r 12 } } rule start { terminal1 { r 12 } } rule start { terminal4 { r 12 } } rule start { terminal4 { r 12 } } rule start .05 { terminal2 { r 12 } } rule terminal4 { SQUARE { b 0.50 s .055 sat 0.40 hue 95 } SQUARE { b 1 s .055 a -.8 } train { x .06 } train { r 90 y .06 } train { r 180 x -.06 } train { r 270 y -.06 } } rule terminal2 2 { SQUARE { b 1 s .055 a -.85 } train { r 90 y .06 } train { r 270 y -.06 } } rule terminal2 1 { SQUARE { b 1 s .055 a -.8 } train { x .06 } train { r 90 y .06 } } rule terminal2 1 { SQUARE { b 1 s .055 a -.85 } train { x.06 } train { r 270 y -.06 } } rule terminal1 { CIRCLE { b 1 s .055 a -.9 } train { r 90 y .06 } } rule terminal1 { CIRCLE { b 1 s .055 a -.9 } train { r -90 y -.06 } } rule train 1 { CIRCLE { b 1 s .045 a -.9 } train { x .06 } } rule train 2 { terminal1 { } } rule train .02 { terminal2 { } } rule train .005 { terminal4 { } } rule train .03 { CIRCLE { b 1 s .03 a -.9 r -95 } }

Keith's Blog

A teen's .net musings

JavaScript Text Adventure

Posted on May 5, 2010 at 9:00 AM

I am going to start a series on JavaScript. The main reason being that it is the only way for windows users to program for the iphone.

My first project is a text adventure written in JavaScript. My first version (0.1) is going to only include a simple set of rooms and exits and only one command: go. The way that I will set up movement and actions is by links that I make on bolded text in the script. I create code in html from the script that then executes the command with the event “onclick”.

The code is quite simple and since it is in JavaScript, it will also work in my blog! Eventually I will make it so that you can also control the commands through certain key presses, similar to rogue.

Well without further ado… JSAdventure version 0.1

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading