Monster Racer Rush
Select between 5 monster racers, upgrade your monster skill and win the competition!
4.18 / 5.00 3,534 ViewsBuild and Base
Build most powerful forces, unleash hordes of monster and control your soldiers!
3.80 / 5.00 4,200 ViewsI'm new to actionscript, and I'm making a game with tiles in AS3. I've been using a tutorial I found here on Newgrounds, but I'm having a problem. I've followed the tutorial, it's from the 08 tutorial collab, but each time I try to test the game I get a ton of undefined property errors and an undefined method error. Apparently properties d, game,tiles, c, and r are undefined properties, and createEmptyMovieClip is an undefined method. Here is all of my code, it's all from the first and only frame.
map1 = [[0,0,0,0,0,0,0,0,0,0],
[0,1,1,1,0,0,0,0,0,0],
[0,1,0,0,0,0,0,0,0,0],
[0,1,1,1,0,0,0,0,0,0],
[0,0,0,1,0,0,1,1,0,0],
[0,1,1,1,0,0,1,0,1,0],
[0,0,0,0,0,0,1,0,1,0],
[0,0,0,0,0,0,1,0,1,0],
[0,0,0,0,0,0,1,1,0,0],
[0,0,0,0,0,0,0,0,0,0]];
game = {tileW:30,tileH:30};
d = 0;
game.tile0 = function() {};
game.tile0.prototype.frame = 1;
game.tile0 = function() {};
game.tile0.prototype.frame = 2
function buildMap(map){
createEmptyMovieClip("tiles",++d);
game.clip = tiles;
for(r = 0;r < map.length;++r){
for(c = 0;c < map[0].length;++c){
name = "tile_"+r+"_"+c;
game[name] = new game["tile"+map[r][c]];
game.clip.attachMovie("tile",name,++d);
game.clip[name]._x = game.tileW * c;
game.clip[name]._y = game.tileH * r;
game.clip[name].gotoAndStop(game[name].frame);
};
};
};
buildMap(map1); At 12/14/12 01:35 PM, creepernaut wrote: I'm new to actionscript, and I'm making a game with tiles in AS3.
The code you are using is AS2.
You can solve pretty much any problem you may have with AS3 by consulting the AS3 Language reference.
That's because the code is in AS2.
Start here. I wrote a tutorial on tile-based mechanics, but you should start with basic AS3 first.