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

JSAdventure Items

Posted on May 6, 2010 at 1:20 AM

I have now added item support to my text adventure. I will now tentatively do a post a day on it with new features every post. This post is on the items. I made a new function called item which I can then use to create a new object as though it were a constructor like so…

function item(name, container, carryable) { 
    this.name = name;
    this.container = container;
    if (container) {
        this.container.items.push(this);
    }
    else {
        inventory.push(this);
    }
    this.carryable = carryable;
}

This does two main things: First, it allows me to create a new object with the name, container, and carryable properties set on it, and second, it makes it so that I don’t have to add the object to the inventory or list of items in the room because it does it for me. I did this mainly because I’m lazy ( As a side note I had a book that told me that was a good thing in programming. How wrong that was! ) but also because it makes it so that I don’t have to think about that ever again while I am coding. I also have been working on adding locking capabilities to exit and I made it so that some of the items can not be carryable ( is that a word? ) and will display a nice message saying go try again. Later I plan to make a property on item that allows me to assign a function that is executed through a command on items to do other things than just pickup, drop, and unlock doors. Any way if you have any suggestions, please feel free to leave a comment.

You do not have javascript enabled currently. Please enable javascript to play my game.

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

DPMud lives on! For now...

Posted on April 25, 2010 at 7:41 AM

We have finaly given up on adding security to the login for dpmud because it was just moving to slowely and the mixture o wcf and silverlight doesn't leave a good taste in my mouth. So we move on. No promises when we will finish though...