לוגו אתר Fresh          
 
 
  אפשרות תפריט  ראשי     אפשרות תפריט  צ'אט     אפשרות תפריט  מבזקים     אפשרות תפריט  צור קשר     חץ שמאלה ‎print ‎"Hello World!"; if‎ ‎not rules.‎know ‎then rules.‎read(); חץ ימינה  

לך אחורה   לובי הפורומים > מחשבים > תכנות ובניית אתרים
שמור לעצמך קישור לדף זה באתרי שמירת קישורים חברתיים
תגובה
 
כלי אשכול חפש באשכול זה



  #1  
ישן 26-11-2006, 19:00
  boaz_95 boaz_95 אינו מחובר  
 
חבר מתאריך: 10.06.06
הודעות: 7
משחק בפלאש עזרה בקוד

עשיתי ככה משחק:
קוד:
stop(); function initGame() { // the range of falling apple clips firstApple = 1; lastApple = 0; // init the score score = 0; // set the number of apples to fall totalApples = 30; // init the speed and time delay timeSinceLastApple = 0; appleSpeed = 15; // create the fox so that it is on top of the apples attachMovie( "running fox", "fox", 999999 ); fox._x = 275; fox._y = 300; } function moveFox() { // check for arrow keys if (Key.isDown(Key.RIGHT)) { dx = 10; // fox faces right fox._xscale = -Math.abs(fox._xscale); } else if (Key.isDown(Key.LEFT)) { dx = -10; // fox faces left fox._xscale = Math.abs(fox._xscale); } else { // no movement dx = 0; } // move the fox and limit that movement fox._x += dx; if (fox._x < 30) fox._x = 30; if (fox._x > 520) fox._x = 520; // make the fox run or stand still if ((dx != 0) and (fox._currentFrame == 1)) { fox.gotoAndPlay("run"); } else if ((dx == 0) and (fox._currentFrame != 1)) { fox.gotoAndPlay("stand"); } } function dropNewApple() { // only drop if it has been long enough if (timeSinceLastApple > 20) { // only drop if there are more apples if (lastApple < totalApples) { // only drop 10% of the time if (Math.random() < .1) { // create next apple and set its locations lastApple++; attachMovie( "apple", "apple"+lastApple, lastApple ); _root["apple"+lastApple]._x = Math.random()*490+30; _root["apple"+lastApple]._y = 0; // reset time delay for next apple timeSinceLastApple = 0; // increase apple speed if (appleSpeed < 10) appleSpeed += .5; } } } // even if no apple dropped, get closer to next drop timeSinceLastApple++; } function moveApples() { // loop through all existing apple clips for (i=firstApple;i<=lastApple;i++) { // get apple location x = _root["apple"+i]._x; y = _root["apple"+i]._y + appleSpeed; // see if apple reached ground if (y > 400) { removeApple(i); // see if apple hit basket } else if ((Math.abs(y-fox._y) < 48) and (Math.abs(x-fox._x) < 30)) { removeApple(i); score += 1; // continue to move apple } else { _root["apple"+i]._y = y; } } } function removeApple(n) { // take away apple movie clip _root["apple"+n].removeMovieClip(); // reset range of apples to move firstApple = n+1; // see if this was the last apple if (n == totalApples) { fox.removeMovieClip(); gotoAndPlay("game over"); } }


עכשיו אני רוצה שיפול מדי פעם חוץ מה apple גם לדוגמה banana
ושזה יתן 5 נקודות לא אחת, וגם להוסיף שיפול גם לדוגמה bullet שזה יפסיק את המשחק אוטמוטית ויפסיל אותך
וקוד אחרון שאני רוצה להוסיף זה קוד שברגע שאני אוסף 20 (לדוגמה) apples זה יעביר אותי לסצנה שאני בוחר

תודה
תגובה ללא ציטוט תגובה עם ציטוט חזרה לפורום
תגובה

כלי אשכול חפש באשכול זה
חפש באשכול זה:

חיפוש מתקדם
מצבי תצוגה דרג אשכול זה
דרג אשכול זה:

מזער את תיבת המידע אפשרויות משלוח הודעות
אתה לא יכול לפתוח אשכולות חדשים
אתה לא יכול להגיב לאשכולות
אתה לא יכול לצרף קבצים
אתה לא יכול לערוך את ההודעות שלך

קוד vB פעיל
קוד [IMG] פעיל
קוד HTML כבוי
מעבר לפורום



כל הזמנים המוצגים בדף זה הם לפי איזור זמן GMT +2. השעה כעת היא 21:20

הדף נוצר ב 0.03 שניות עם 12 שאילתות

הפורום מבוסס על vBulletin, גירסא 3.0.6
כל הזכויות לתוכנת הפורומים שמורות © 2025 - 2000 לחברת Jelsoft Enterprises.
כל הזכויות שמורות ל Fresh.co.il ©

צור קשר | תקנון האתר