Quote:
Originally Posted by cbk1994
For example, if you wanted to create your own tileset layout without a custom movement system (syntax up for debate):
|
If the hard-coded movement system were to use a scripted function, it would be the equivalent of using a 0.05s timeout script to check wall collisions. With a more complex custom tileset design, the custom tileType function could be slightly cpu intensive, unless you used some hackish method to streamline the function. This is just something I thought up on the spot, but I guess something like this would remove the need for conditional statements in the tileType function...
PHP Code:
//#CLIENTSIDE
function onCreated() {
temp.watertiles = {1,2,3};
temp.blockingtiles = {4,5,6};
for (temp.i: watertiles)
(@"tiletype_"@i) = 11;
for (temp.i: blockingtiles)
(@"tiletype_"@i) = 22;
tileType = function(x, y) {
return (@"tiletype_"@this.level.tiles[x, y]);
};
onWall = function(x, y) {
return tileType(x, y) == 22;
};
}
Function overriding would be useful in some cases I guess.
I would also really like to see the prototype idea implemented.