|
-
Senior Member
[HELP] Can some1 help me in my game
I am wanting to create a tile based platform game, i have bin using tonypa's tuturoials as guidlines but i havnt been able to fine anything to help in tweeking sertain things and i am new to flash and arnt experianced enough i do it my self..
how would i create a new doors prototype so when the hero moves over the door instead of going to new map and x and y cordinates go to and stop on a difernet frame here is the following code for the orignal door statment
Code:
game.Doors = function (newmap, newcharx, newchary) { this.newmap = newmap;this.newcharx = newcharx;this.newchary = newchary;};
game.Doors.prototype.walkable = true;
game.Doors.prototype.frame = 3;
game.Doors.prototype.door = true;
and the actualy door placment
Code:
game.Tile2 = function () { };
game.Tile2.prototype = new game.Doors(newmap, newcharx, newchary);
this is also some code for the hero to check if there is a door dose this need to be changes aswell??
Code:
if (game["t_"+ob.ytile+"_"+ob.xtile].door and ob == _root.char) {
-
Senior Member
game.Doors = function (newFrame) {
this.newFrame=newFrame;
};
game.Doors.prototype.walkable = true;
game.Doors.prototype.frame = 3;
game.Doors.prototype.door = true;
game.Tile2 = function () { };
//send movie to frame 24 when the door on tile 2 is stepped on
game.Tile2.prototype = new game.Doors(24);
function changeMap (ob) {
var name = "t_"+ob.ytile+"_"+ob.xtile;
_root.gotoAndStop(game[name].newMap);
}
-
Senior Member
i did that but it for sum reason takes me back to frame 1 why? am i suposed to have
game.Doors = function (newFrame,newmap, newcharx, newchary) {this.newFrame=newFrame;this.newmap = newmap;this.newcharx = newcharx;this.newchary = newchary;};
game.Doors.prototype.walkable = true;
game.Doors.prototype.frame = 3;
game.Doors.prototype.door = true;
or just
game.Doors = function (newFrame) {
this.newFrame=newFrame;
};
game.Doors.prototype.walkable = true;
game.Doors.prototype.frame = 3;
game.Doors.prototype.door = true;
BTW i dont plan on hvaing a map on frame (24) so i got
function changeMap(ob)
var name = "t_"+ob.ytile+"_"+ob.xtile;
removeMovieClip(_root.tiles);
_root.gotoAndStop(game[name].newMap);
beacuse i have a hole lota other code were that gose will it interfere with the origanal doors prototype
this is the original code without that stuff
function changeMap(ob) {
var tempitems = [];
for (var i = 0; i<game.items.length; ++i) {
if (game.items[i]) {
appear in next map
var name = "item"+game.items[i][2]+"_"+game.items[i][1];
delete game[name];
tempitems.push(game.items[i]);
}
-
Senior Member
No, you dont need all the "newmap, newcharx, newchary" anymore. You still need to create door tile before you can use it (tile2 in my last reply) and place it in the map array. I dont know if you need to deal with items in changeMap function, they are only needed if you plan to return to same map later and you want items to be disappeared after they were picked up.
Try to explain better what you want to do and why.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|