modyKun
02-06-2010, 06:03 AM
السلام عليكم ورحمة الله وبركاته ^^
بما إني عاطل اليومين دول xD عشان كان عندي أساساً تحدي في مواجهة برنس وسامي..لكن فجأة الكمبيوتر خرب لوحده والحمد لله xD" بس الملفات سليمة ^___^ الحمد لله على أي حال XD
المهم بكرا من المتوقع بستعيد الملفات ^^ .. فقررت أبدأ في مشروع بسيط بما إني فاضي وحاسس إني بضيع وقت xDD
المشروع ببساطة هو لعبة ..هممم مش عارف ازاي اشرحها xD
لما تبقى في بطاقات غير مكشوفة ^^ والمطلوب منك تطلع المتشابهة..ولما تفتح بطاقتين ويطلعوا متشابهتين ينمحوا ^^"
لحد دلوقتي معملتش حاجة xS بس كتبت تخطيط بسيط لشكل الكود (ملاحظة : غير كامل ، بستخدمه كنت لترتيب أفكاري بس ^^ )
---------------------------------init() :
-init game state to "start"
-put cards into random order in the array -init the timer and equal it to 20
---------------------------------Update() :
if gameState == "start"
{
-set gameStartButton to alive
-set quit to alive
}
if gameState =="game"
{
-set quit,gameStartButton , youWinText, youLoseText , tryAgainButton alive to false
-descrease the timer by 1
-if the player clicks on a card , it changes "shown" to true
-if two cards in the array equals each other and are "shown" , then set them as "matching"
and set the actionTime to the current second-1
-if two cards in the array doesn't equal each other and are "shown" , then set them as
"unmatching" and set the actionTime to the current second-1
-for each card in the array , if it's set to "matching" and it's actionTime==currentTime ,
then destroy the card by setting isDestroyed to true, if it's set to "unmatching" and it's
actionTime==currentTime then set "shown" to false and change "state" to NULL
-if all cards are destroyed , then change game state to "won"
-if the timer is 0 and there are cards that are not destroyed change game state to "loss"
}
if gameState == "won"
{
-set youWinText to alive
-set tryAgainButton to alive
-set quit to alive
}
if gameState == "loss"
{
-set youLoseText to alive
-set tryAgainButton to alive
-set quit to alive
}
------------buttonsHandler(button) :
-if isInside(mouseX,mouseY) then set hover to true else set it to false
-if isInside & mouse clicked then set clicked to true else set clicked to false
كل الأفكار حالياً مترتبة وعلى ما أتمنى فالمشروع بإذن الله هيخلص بسرعة ^_^"
هدفي أخلصه في يوم إلى يومين بإذن الله ^_^
مع إني بكرا بالكامل حكون مشغول بإذن الله xD
بما إني عاطل اليومين دول xD عشان كان عندي أساساً تحدي في مواجهة برنس وسامي..لكن فجأة الكمبيوتر خرب لوحده والحمد لله xD" بس الملفات سليمة ^___^ الحمد لله على أي حال XD
المهم بكرا من المتوقع بستعيد الملفات ^^ .. فقررت أبدأ في مشروع بسيط بما إني فاضي وحاسس إني بضيع وقت xDD
المشروع ببساطة هو لعبة ..هممم مش عارف ازاي اشرحها xD
لما تبقى في بطاقات غير مكشوفة ^^ والمطلوب منك تطلع المتشابهة..ولما تفتح بطاقتين ويطلعوا متشابهتين ينمحوا ^^"
لحد دلوقتي معملتش حاجة xS بس كتبت تخطيط بسيط لشكل الكود (ملاحظة : غير كامل ، بستخدمه كنت لترتيب أفكاري بس ^^ )
---------------------------------init() :
-init game state to "start"
-put cards into random order in the array -init the timer and equal it to 20
---------------------------------Update() :
if gameState == "start"
{
-set gameStartButton to alive
-set quit to alive
}
if gameState =="game"
{
-set quit,gameStartButton , youWinText, youLoseText , tryAgainButton alive to false
-descrease the timer by 1
-if the player clicks on a card , it changes "shown" to true
-if two cards in the array equals each other and are "shown" , then set them as "matching"
and set the actionTime to the current second-1
-if two cards in the array doesn't equal each other and are "shown" , then set them as
"unmatching" and set the actionTime to the current second-1
-for each card in the array , if it's set to "matching" and it's actionTime==currentTime ,
then destroy the card by setting isDestroyed to true, if it's set to "unmatching" and it's
actionTime==currentTime then set "shown" to false and change "state" to NULL
-if all cards are destroyed , then change game state to "won"
-if the timer is 0 and there are cards that are not destroyed change game state to "loss"
}
if gameState == "won"
{
-set youWinText to alive
-set tryAgainButton to alive
-set quit to alive
}
if gameState == "loss"
{
-set youLoseText to alive
-set tryAgainButton to alive
-set quit to alive
}
------------buttonsHandler(button) :
-if isInside(mouseX,mouseY) then set hover to true else set it to false
-if isInside & mouse clicked then set clicked to true else set clicked to false
كل الأفكار حالياً مترتبة وعلى ما أتمنى فالمشروع بإذن الله هيخلص بسرعة ^_^"
هدفي أخلصه في يوم إلى يومين بإذن الله ^_^
مع إني بكرا بالكامل حكون مشغول بإذن الله xD