ERLEDIGT
NEIN
NEIN
ANTWORTEN
0
0
ZUGRIFFE
2086
2086
EMPFEHLEN
-
24.03.03 08:39 #1
Hi Folks,
Hier was zum ausprobieren - hiermit lassen sich Spielfelder einfach umsetzen.
Beispiel:PHP-Code:MovieClip.prototype.panicMouse = function(distanz, tempo, besch){
var xdiff = this._parent._xmouse - this._x;
var ydiff = this._parent._ymouse - this._y;
var abstand = Math.sqrt(xdiff*xdiff + ydiff*ydiff);
if (abstand < distanz){
var winkel = Math.atan2(ydiff, xdiff);
if (besch) tempo = Math.min(tempo, besch*distanz/abstand);
this._x -= Math.cos(winkel)*tempo;
this._y -= Math.sin(winkel)*tempo;
}
}
MovieClip.prototype.constrainTo = function(cF){
var tb = this.getBounds();
if (typeof cF == "movieclip") cF = cF.getBounds(this._parent);
if (this._x + tb.xmin < cF.xmin) this._x = cF.xmin + tb.xmax;
if (this._x + tb.xmax > cF.xmax) this._x = cF.xmax + tb.xmin;
if (this._y + tb.ymin < cF.ymin) this._y = cF.ymin + tb.ymax;
if (this._y + tb.ymax > cF.ymax) this._y = cF.ymax + tb.ymin;
}
http://www.flashangel.de/mx/fsconstrain.swf
Download:
http://www.flashstar.de/tutlist/FlashStar:
http://www.flashstar.de
[Flash Experimentals - News - Links]
Flashpower:
http://www.flashpower.de
[Flash Portal - Prototypes]
ActionScript Praxis:
http://www.actionscript-praxis.de
[Buchinfo - Ergänzungen - Zusatz Material]
Bücher zu Flash 8 und CS3:
HotStuff Buch -=- Professional Series Buch -=- Flash CS3 Powerworkshops
Ähnliche Themen
-
Bots ausschließen
Von Moritz123 im Forum PHPAntworten: 5Letzter Beitrag: 23.12.09, 19:29 -
Spam Bots im Gästebuch
Von oldputz1990 im Forum PHPAntworten: 34Letzter Beitrag: 19.09.07, 17:01 -
Halflife Paintball Bots?
Von Philipp Schindler im Forum Fun-ForumAntworten: 11Letzter Beitrag: 08.06.04, 16:20 -
Bots in Foren ******
Von pyr0t0n im Forum SmalltalkAntworten: 3Letzter Beitrag: 11.06.03, 18:21 -
irc bots :(!
Von mcR*sMb im Forum HTML-EditorenAntworten: 2Letzter Beitrag: 01.03.02, 22:38





Login





