Blockland Forums > Suggestions & Requests
In-Game Programming Language
TheGermanKid:
This has been killing me since I got the game (about a year ago).
Why doesn't Blockland have an IN-GAME programming language, this would add a whole new level of creativity that wrench events cannot offer.
I have thought about it and I have determined that the language should be BASIC, JavaScript, or Objective-C based.
I believe that Objective-C style would be best, it's fairly easy to learn.
Example
--- Code: ---/* Finds brick with given name and sets it's color to red */
Brick *brick;
NSString *name;
name = @"brickName";
brick = [[Brick alloc] initWithExistingBrick:name];
[brick setColor: [NSColor colorWithCalibratedRed:1.0f green:0.0f blue:0.0f alpha:1.0f]];
[brick commitChanges:nil];
--- End code ---
...Or...
--- Code: ---/* Creates new brick */
Brick *brick;
BrickShape *shape;
NSString *name;
NSColor *color;
name = @"brickName";
color = [NSColor colorWithCalibratedRed:1.0f green:1.0f blue:1.0f alpha:1.0f]; /* White BTW */
[shape setStyle:@"cube"]; /* Style can be "cube", "flat", "special", etc. */
[shape setWidth:20]; /* 20 units wide */
[shape setHeight:20];
[shape setLength:20];
[shape setPrint:NO]; /* Set whether or not the brick is a print brick */
[shape setXCoord:0 yCoord:0 zCoord:0];
brick = [[Brick alloc] initWithName:name shape:shape color:color];
--- End code ---
The code could be assigned to a specific brick, like wrench events.
This would add a whole new level of functionality.
Thanks.
TheGermanKid:
Let's say you wanted to run some code only if a specific condition is true, or maybe create a line of bricks.
Here is the code...
--- Code: ---/* Run if condition is true... */
Brick *brick;
NSString *name;
name = @"brickName";
brick = [[Brick alloc] initWithExistingBrick:name];
if (brick.printChar == "A") {
/* Some Code... */
}
--- End code ---
...Or to create a line of bricks...
--- Code: ---Brick *brick;
BrickShape *shape;
NSString *name;
NSColor *color;
NSInteger count;
name = @"brickName";
color = [NSColor colorWithCalibratedRed:1.0f green:1.0f blue:1.0f alpha:1.0f]; /* White BTW */
[shape setStyle:@"cube"]; /* Style can be "cube", "flat", "special", etc. */
[shape setWidth:20]; /* 20 units wide */
[shape setHeight:20];
[shape setLength:20];
[shape setPrint:NO]; /* Set whether or not the brick is a print brick */
while (count < 5) {
[shape setXCoord:count yCoord:0 zCoord:0];
brick = [[Brick alloc] initWithName:name shape:shape color:color];
}
--- End code ---
zoneark:
Truce was planning on doing something like this back in the day.
TheGermanKid:
--- Quote from: zoneark on June 03, 2009, 01:56:17 AM ---Truce was planning on doing something like this back in the day.
--- End quote ---
Really?
zoneark:
--- Quote from: TheGermanKid on June 03, 2009, 01:58:32 AM ---Really?
--- End quote ---
Yeah he was going to make a clientside based game in a gui where you could play a game like "tic tac toe" while playing blockland. It was going to use a custom made scripting language that even a monkey could learn.