I'm trying to make it more like Sphere had it, without just turning RequireScript into a C-style include that will just dump the second script into the first. There surely are elegant solutions working just with V8. But I don't know exactly how to do that yet.
No kidding, line error's are in the 1000's!
I don't know if this is a bug or feature, but you've made Sphere Objects [object Object] types rather than [object Image] etc. which Sphere did. So, it's harder to tell if an image is an image or some object.
Edit: Now I'm running into an issue with the console. I don't see the entire log. I'm loading hundreds of scripts, okay, so the console has a huge list of stuff, but only stops half-way before the screen pops up running. Then when an error occurs, nothing else is added to the console.
$ ./turbosphere.exe
Fixed plugins: 1
Fixed plugins as recorded: 1
Opening SGM file startup/game.sgm
Opening script startup/scripts/main.js
File is good.
Opening script startup/scripts/radlib/radlib.js
File is good.
Opening script startup/scripts/radlib/radextend.js
File is good.
No JS result will be passed
Opening script startup/scripts/radlib/animation.js
File is good.
JS Result will be passed.
function (x, y) {
this.frames[this.frame].i.blitMask(x, y, this.color);
}
Opening script startup/scripts/radlib/assert.js
File is good.
No JS result will be passed
Opening script startup/scripts/radlib/audio.js
File is good.
No JS result will be passed
Opening script startup/scripts/radlib/colors.js
File is good.
No JS result will be passed
Opening script startup/scripts/radlib/debug.js
File is good.
Opening script startup/scripts/radlib/game.js
File is good.
Opening script startup/scripts/radlib/hooklist.js
File is good.
JS Result will be passed.
function (key) {
var hook = List.get(this.hooks, key, "key");
hook.paused = false;
}
No JS result will be passed
No JS result will be passed
Opening script startup/scripts/radlib/event.js
File is good.
JS Result will be passed.
function () {
return this.parent.constructor.name;
}
Opening script startup/scripts/radlib/game.js
File is good.
Opening script startup/scripts/radlib/hooklist.js
File is good.
JS Result will be passed.
function (key) {
var hook = List.get(this.hooks, key, "key");
hook.paused = false;
}
No JS result will be passed
Opening script startup/scripts/radlib/hooklist.js
File is good.
JS Result will be passed.
function (key) {
var hook = List.get(this.hooks, key, "key");
hook.paused = false;
}
Opening script startup/scripts/radlib/inherit.js
File is good.
No JS result will be passed
Opening script startup/scripts/radlib/input.js
File is good.
JS Result will be passed.
function (button) {
return IsJoystickButtonPressed(this.num, button);
}
Opening script startup/scripts/radlib/image.js
File is good.
JS Result will be passed.
function (x1, y1, radimg, x2, y2) {
// setup positions:
var top = Math.max(y1, y2);
var left = Math.max(x1, x2);
var right = Math.min(x1 + this.width , x2 + radimg.width )-1;
var bottom = Math.min(y1 + this.height, y2 + radimg.height)-1;
// collision:
var colA, colB;
for (var y = top; y < bottom; ++y) {
for (var x = left; x < right; ++x)
{
colA = this.canvas.getPixel(x - x1, y - y1);
colB = radimg.canvas.getPixel(x - x2, y - y2);
if (colA.alpha > 0 && colB.alpha > 0) return true;
}
}
return false;
}
Opening script startup/scripts/radlib/json2.js
File is good.
No JS result will be passed
Opening script startup/scripts/radlib/list.js
File is good.
Opening script startup/scripts/radlib/assert.js
File is good.
No JS result will be passed
Opening script startup/scripts/radlib/debug.js
File is good.
Opening script startup/scripts/radlib/game.js
File is good.
Opening script startup/scripts/radlib/hooklist.js
File is good.
JS Result will be passed.
function (key) {
var hook = List.get(this.hooks, key, "key");
hook.paused = false;
}
No JS result will be passed
No JS result will be passed
No JS result will be passed
Opening script startup/scripts/radlib/loader.js
File is good.
No JS result will be passed
Opening script startup/scripts/radlib/mouse.js
File is good.
No JS result will be passed
Opening script startup/scripts/radlib/path.js
File is good.
No JS result will be passed
Opening script startup/scripts/radlib/resources.js
File is good.
No JS result will be passed
Opening script startup/scripts/radlib/savefile.js
File is good.
Opening script startup/scripts/radlib/json2.js
File is good.
No JS result will be passed
JS Result will be passed.
function (filename) {
if (!Assert.is(filename, "string")) { Debug.log("Filename not a string.", LIB_ERROR); return; }
if (filename.indexOf(".") < 0) filename += ".sav";
if (!Assert.fileExists("~/other/", filename)) {
Debug.log(FormatString("File {?} doesn't exist!", filename), LIB_ERROR);
return;
}
var file = OpenRawFile("~/other/" + filename);
this.content = JSON.parse(CreateStrin
Edit2: Only when there's a script error hmm... Weird.