Mapeditor pour blackwizzard's lemmings

Description

vous voulez creer vos map pour lemmings?
C simple!
downloadez le fichier joins!

les carreau s'inverse au passage de la souris.
pour aller a un point sans tout noircir au passege, clickez et laissé appuyé. deplacé la souris et lachez le click.
Pour les elements, faites un drag'n drop, sachant que le rectangle bleu est la porte d'entré des lemmings et que l'icon superman est desactivé.

ensuite, une fois votre map faite, cliquez sur generate.

là, en bas a droite ya du code qui apparait.
selectionnez un morceau et selectionnez tout avec ctrl+a.
copiez et colez dans un fichier texte que vous renomez en .xml

Source / Exemple :


MAP_FILE = "map.xml";
MAP_XML = new XML();
MAP_XML.ignoreWhite = true;
SIZE_X = 41;
SIZE_Y = 33;
_root.onLoad = function() {
	MAP_XML.load(MAP_FILE);
	MAP_XML.onLoad = function(success) {
		MAP_XML.parse();
	};
};
//
XML.prototype.parse = function() {
	local_xml = new XML();
	local_xml.ignoreWhite = true;
	local_xml = this.childNodes[0].childNodes[0];
	_root.LEMMING_NUMBER = this.childNodes[0].childNodes[2].attributes.number;
	_root.LEMMING_GATE_X = this.childNodes[0].childNodes[1].attributes.x;
	_root.LEMMING_GATE_Y = this.childNodes[0].childNodes[1].attributes.y;
	_root.numman.text = _root.LEMMING_NUMBER;
	_root.gate._x = _root.LEMMING_GATE_X;
	_root.gate._y = _root.LEMMING_GATE_Y;
	_root.numup.text = this.childNodes[0].childNodes[3].attributes.number;
	_root.numdown.text = this.childNodes[0].childNodes[4].attributes.number;
	_root.numleft.text = this.childNodes[0].childNodes[5].attributes.number;
	_root.numright.text = this.childNodes[0].childNodes[6].attributes.number;
	_root.bad_viral._x = this.childNodes[0].childNodes[7].attributes.x;
	_root.bad_viral._y = this.childNodes[0].childNodes[7].attributes.y;
	_root.bad_bomb._x = this.childNodes[0].childNodes[8].attributes.x;
	_root.bad_bomb._y = this.childNodes[0].childNodes[8].attributes.y;
	_root.bad_microwave._x = this.childNodes[0].childNodes[9].attributes.x;
	_root.bad_microwave._y = this.childNodes[0].childNodes[9].attributes.y;
	_root.bad_pentacle._x = this.childNodes[0].childNodes[10].attributes.x;
	_root.bad_pentacle._y = this.childNodes[0].childNodes[10].attributes.y;
	_root.bad_pylon._x = this.childNodes[0].childNodes[11].attributes.x;
	_root.bad_pylon._y = this.childNodes[0].childNodes[11].attributes.y;
	var i = 0;
	while (i != SIZE_Y) {
		var k = 0;
		while (k != SIZE_X) {
			_root.map.build(k*12, i*12, Number(local_xml.childNodes[i].childNodes[k].attributes.value)+1);
			k++;
		}
		i++;
	}
};
//
MovieClip.prototype.build = function(x, y, id) {
	if (id != 1 && id != 2) {
		_root.otp += (id);
	}
	maptile++;
	this.tile.duplicateMovieClip("tile"+maptile, maptile);
	this["tile"+maptile]._x = x;
	this["tile"+maptile]._y = y;
	this["tile"+maptile].gotoAndStop(id);
	this["tile"+maptile].id = id-1;
	this["tile"+maptile].n.text = id-1;
	this["tile"+maptile].p = id;
	this["tile"+maptile].tile.gotoAndStop(id);
	this["tile"+maptile]._alpha = 100;
};
//
function generate() {
	_root.export.export.text = "";
	_root.export.export._visible = 1;
	_root.export.scr._visible = 1;
	_root.otp = ("<?xml version='1.0' encoding='UTF-8' ?>");
	_root.otp += ("<mapfile>");
	_root.otp += ("<map>");
	local_xml = new XML();
	local_xml.ignoreWhite = true;
	local_xml = MAP_XML.childNodes[0].childNodes[0];
	var i = 0;
	var tile = 1;
	while (i<SIZE_Y) {
		var k = 0;
		_root.otp += ("<line>");
		while (k<SIZE_X) {
			_root.otp += ("<tile value=\""+_root.map["tile"+tile].id+"\" />");
			k++;
			tile++;
		}
		_root.otp += ("</line>");
		i++;
	}
	_root.otp += ("</map>");
	var i = 0;
	var tile = 1;
	local_xml = MAP_XML.childNodes[0].childNodes[0];
	_root.otp += ("<gate x=\""+_root.gate._x+"\" y=\""+_root.gate._y+"\" />");
	_root.otp += ("<param number=\""+_root.numman.text+"\" />");
	_root.otp += ("<object number=\""+_root.numup.text+"\" />");
	_root.otp += ("<object number=\""+_root.numdown.text+"\" />");
	_root.otp += ("<object number=\""+_root.numleft.text+"\" />");
	_root.otp += ("<object number=\""+_root.numright.text+"\" />");
	_root.otp += ("<object x=\""+_root.bad_viral._x+"\" y=\""+_root.bad_viral._y+"\" />");
	_root.otp += ("<object x=\""+_root.bad_bomb._x+"\" y=\""+_root.bad_bomb._y+"\" />");
	_root.otp += ("<object x=\""+_root.bad_microwave._x+"\" y=\""+_root.bad_microwave._y+"\" />");
	_root.otp += ("<object x=\""+_root.bad_pentacle._x+"\" y=\""+_root.bad_pentacle._y+"\" />");
	_root.otp += ("<object x=\""+_root.bad_pylon._x+"\" y=\""+_root.bad_pylon._y+"\" />");
	_root.otp += ("</mapfile>");
	_root.output.text = _root.otp;
	_root.export.scr.setScrollProperties(tile+3, 0, tile+3);
	_root.export.scr.setScrollTarget(_root.export.export);
}

Conclusion :


aide, support sur
http://hosting.allboard.net/crowy/board/viewtopic.php?t=261

Codes Sources

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.