20-10-2007, 14:06
|
|
|
חבר מתאריך: 10.10.07
הודעות: 61
|
|
אני מוסיפה הערות
ציטוט:
במקור נכתב על ידי ella10004
קוד:
הקוד נמצא בכל אחת מהתמונות שצריכות לבוא מאחורי הקלפים שמסתירים אותן
onClipEvent (enterFrame) {
הקוד עובד אינסוף פעמים
if (this._alpha != 50) {
אם האלפה הוא כן 50 אז זה אומר שהקלף כבר קיבל את מקומו ולא קורה כלום
if (this._y == 50) {
if (this._x == 50) {
בודק מיקום של התמונה
this._alpha = 50;
אם היא קיבלה את המיקום-האלפה 50 ואז הקוד לא יעבוד
}
}
if (this._y == 50) {
if (this._x == 108) {
this._alpha = 50;
}
}
if (this._y == 50) {
if (this._x == 166) {
this._alpha = 50;
}
}
if (this._y == 50) {
if (this._x == 224) {
this._alpha = 50;
}
}
if (this._y == 108) {
if (this._x == 50) {
this._alpha = 50;
}
}
if (this._y == 108) {
if (this._x == 108) {
this._alpha = 50;
}
}
if (this._y == 108) {
if (this._x == 166) {
this._alpha = 50;
}
}
if (this._y == 108) {
if (this._x == 224) {
this._alpha = 50;
}
}
if (this._y == 166) {
if (this._x == 50) {
this._alpha = 50;
}
}
if (this._y == 166) {
if (this._x == 108) {
this._alpha = 50;
}
}
if (this._y == 166) {
if (this._x == 166) {
this._alpha = 50;
}
}
if (this._y == 166) {
if (this._x == 224) {
this._alpha = 50;
}
}
if (this._y == 224) {
if (this._x == 50) {
this._alpha = 50;
}
}
if (this._y == 224) {
if (this._x == 108) {
this._alpha = 50;
}
}
if (this._y == 224) {
if (this._x == 166) {
this._alpha = 50;
}
}
if (this._y == 224) {
if (this._x == 224) {
this._alpha = 50;
בדיקת כל המקומות האפשריים מאחורי קלף הושלמה
}
}
if (this.hitTest(_root.a)) {
אם אחת התמונות נוגעת באחרת אז הן באותו מקום סימן שזה לא טוב, כי אסור שתי תמונות מאחורי קלף אחד
this._y = random(282)+1;
this._x = random(224)+1;
התמונות מחליפות מקום
}
if (this.hitTest(_root.b)) {
this._y = random(282)+1;
this._x = random(224)+1;
}
if (this.hitTest(_root.c)) {
this._y = random(282)+1;
this._x = random(224)+1;
}
if (this.hitTest(_root.d)) {
this._y = random(282)+1;
this._x = random(224)+1;
}
if (this.hitTest(_root.f)) {
this._y = random(282)+1;
this._x = random(224)+1;
}
if (this.hitTest(_root.g)) {
this._y = random(282)+1;
this._x = random(224)+1;
}
if (this.hitTest(_root.h)) {
this._y = random(282)+1;
this._x = random(224)+1;
}
if (this.hitTest(_root.i)) {
this._y = random(282)+1;
this._x = random(224)+1;
}
if (this.hitTest(_root.j)) {
this._y = random(282)+1;
this._x = random(224)+1;
אף אחת מהתמונות לא נוגעת באחרת
}
בדיקה של המיקום, אם התמונות לא מאחורי הקלפים אז צריך מקום אחר
if (this._y != 50) {
if (this._y != 108) {
if (this._y != 166) {
if (this._y != 224) {
_y = random(282)+1;
התמונות מקבלות מקום אחר
}
}
}
}
if (this._x != 50) {
if (this._x != 108) {
if (this._x != 166) {
if (this._x != 224) {
_x = random(224)+1;
}
בדיקת המקום נגמרה, התמונות מאחורי הקלפים, והאלפה צריך להיות 50 אבל אם לא אז הכל מתבצע שוב
}
}
}
}
}
מה שקורה זה שהתמונות לא מאחורי הקלפים והן מקבלות אלפה 50 ונעצרות. לפני ששמתי את החלק עם האלפה הכל עבד חוץ מזה שהן לא עצרו כי בעצם כל הזמן תמונה קיבלה מקום ואחרת נגעה בה אז הכל התחיל מחדש
זה לא עובד...
מישהו יודע מה הבעיה?
|
|