29-07-2006, 02:21
|
|
|
חבר מתאריך: 28.07.06
הודעות: 39
|
|
באג במשחק בעיה בקוד
טוב המשחק הוא של אובייקטים נופלים את הקוד יצר משתמש פה שאני לא יודע מה הכינוי שלו בפורום הזה אז...
הקוד משמש למשחק של יצורים נופלים שאתה צריך לחמוק מהם זה הקוד ששמים בפריים הראשון כדאי שהיצורים יפלו הבעיה שגם אחרי שאתה נפסל והוא עובר בצינה לסצינה שכתוב בה גיים אוור ואז התחל מחדש האוייבים ממשיכים ליפול במקום להפסיק זה הקוד
objects = 0 // Do not touch this objects counter
speed = 5 // Object's falling speed
time = 1000 // Time between each object create
amount_each = 1 // Amount of objects dropped each time
obj_name = "ball" // Object Name
function makeobj(obj, rndX, Y, amount) {
for (c = 0; c < amount; c++) {
_root.attachMovie(obj, obj + objects, _root.getNextHighestDepth())
_root[obj + objects]._x = random(rndX)
_root[obj + objects]._y = Y - _root[obj + objects].height
objects++
}
}
setInterval(makeobj, time, obj_name, Stage.width, 0, amount_each)
function checkheight(obj) {
for (i = 0; i < objects + 1; i++) {
if (_root[obj + i].hitTest(_root.iam)) {
removeAllandFinish()
}
if (_root[obj + i]._y < (Stage.height - _root[obj + i]._height)) {
_root[obj + i]._y += speed
_root[obj + i]._rotation += speed
}
else {
if (_root[obj + i]._alpha <= 0) {
_root[obj + i].removeMovieClip()
}
else {
_root[obj + i]._alpha--
}
}
}
}
function removeAllandFinish() {
for (object; objects > 0; objects--) {
_root[obj_name + object].removeMovieClip()
}
_root.nextFrame()
}
onEnterFrame = function() {checkheight(obj_name)}
תודה לכל מי שעוזר =]
|