الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

عاجل جدا-الرجاء المساعدة في تصميم هذة اللعبة

بدأه LovelyMoon في 22 مايو 2009 · 4 رد · 663 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكــم ورحمـة الله وبركاتــه ،،

المطلوب مني هو تصميم لعبة بالمواصفات التالية لكن واجهتني بعض المشاكل في الأكواد- الرجاء مساعدتي لان باقي يوم واحد لتسليم البرنامج

The idea of the game is the following: at the top of running window you need to draw 5 targets. The targets consist of colored rectangle of the same size and color. They must be distributed symmetrically over the width of the running window.

At the bottom of the running window you have a small ball. The horizontal movement of the ball should be controlled by the user. Pressing the left arrow should move the ball horizontally to the left. Pressing the right arrow should move the ball horizontally to the right. Pressing the space bar will lunch the ball vertically to the top of the window. If the ball touches one of the targets, the following events will happen:

1- The corresponding reached target disappears.

2- The score of the corresponding user increments by one.

3- The permitted number of shots for the current player decrements by one.

4- The ball returns back to its last position at the last launching shot.

If the ball did not reach the target, the following events will happen:

1- The permitted number of shots for the current player decrements by one.

2- The ball returns back to its last position at the last launching shot.

The user has the right for 5 shots. The best scenario will happen if the user moves correctly the small ball and shoots the targets in 5 shots.

The movement speed of the ball should be rational. The user can see it clearly and he does not have to wait long in order to see if it destroys the target or not. It should not be very fast, neither very slow.

The session of the player ends after the last shot (5th one). Then, a new player starts shooting the targets. The program does not allow more than four players for the game.

When the program starts, it should ask the user about the number of players. Then, the user enters the names of the corresponding players. Each player has the right for one session. The first session will be for the first entered name, the second session is for the second entered name and so on.

At the end of the game, the program presents the results and the players classifications with respect to their scores. If two players have the same scores they should not be ranked equally. You should look to the time needed by each of them to finish his session. For that reason, you need to add the time factor for each user session. The session time starts when you select the corresponding user and it ends when the user finishes his last shot.

أنا صممت الواجهة لكن عندي مشكلتان لا اعرف كيف أحلهما

أولا عندنا تلمس الكرة المستطيلات او الأهداف لا تختفي ما عدى المستطيل الأول بالرغم من تشابة الكود في كل حالة ؟

ثانيا وهذا المهم جدا لا أعلم كيف أنتقل من اللاعي الأول الى اللاعب التالي بعد ان ينهى الاول الضربات الخمس المتاحة له ؟؟

هذا الكود الذي استخدمه للتأكد من تلامس الكرة مع الأهداف الخمسة مع العلم انى اصعة داخل الحدث الخاص بالTimer

void __fastcall TForm1::Timer1Timer(TObject *Sender)

{

Ball->Top = Ball->Top - 10;

if (Ball->Top <= (R1->Top) + (R1->Height))

{

if(((Ball->Left >= R1->Left) && (Ball->Left <= (R1->Left) + (R1->Width)) || ((Ball->Left) + (Ball->Width) <= R1->Width)))

{

Ball->Visible = false;

R1->Visible = false;

Score ++;

CurrentScore->Caption = "Current Score = " + AnsiString(Score);

}

Timer1->Enabled = false;

Ball->Visible = true;

Ball->Top = LastPosition;

}

if (Ball->Top <= (R2->Top) + (R2->Height))

{

if(((Ball->Left >= R2->Left) && (Ball->Left <= (R2->Left) + (R2->Width)) || ((Ball->Left) + (Ball->Width) <= R2->Width)))

{

Ball->Visible = false;

R2->Visible = false;

Score ++;

CurrentScore->Caption = "Current Score = " + AnsiString(Score);

}

Ball->Visible = true;

Ball->Top = LastPosition;

}

if (Ball->Top <= (R3->Top) + (R3->Height))

{

if(((Ball->Left >= R3->Left) && (Ball->Left <= (R3->Left) + (R3->Width)) || ((Ball->Left) + (Ball->Width) <= R3->Width)))

{

Ball->Visible = false;

R3->Visible = false;

Score ++;

CurrentScore->Caption = "Current Score = " + AnsiString(Score);

}

Ball->Visible = true;

Ball->Top = LastPosition;

}

if (Ball->Top <= (R4->Top) + (R4->Height))

{

if(((Ball->Left >= R4->Left) && (Ball->Left <= (R4->Left) + (R1->Width)) || ((Ball->Left) + (Ball->Width) <= R4->Width)))

{

Ball->Visible = false;

R4->Visible = false;

Score ++;

CurrentScore->Caption = "Current Score = " + AnsiString(Score);

}

Ball->Visible = true;

Ball->Top = LastPosition;

}

if (Ball->Top <= (R5->Top) + (R5->Height))

{

if(((Ball->Left >= R5->Left) && (Ball->Left <= (R5->Left) + (R5->Width)) || ((Ball->Left) + (Ball->Width) <= R5->Width)))

{

Ball->Visible = false;

R5->Visible = false;

Score ++;

CurrentScore->Caption = "Current Score = " + AnsiString(Score);

}

Ball->Visible = true;

Ball->Top = LastPosition;

}

}

#2

أنا كتبت الموضوع مستعجل 19 قرؤا الموضوع ولا أحد يعرف يساعدني !!

#3

No one can help !! after 40 read the topic !!

#4
LovelyMoon كتب:
No one can help !! after 40 read the topic !!

السلام عليكــم ورحمـة الله وبركاتــه ،،

We are so sorry. But honestly it was your mistake to write such topic in such forum, because this forum treats only those topics about Standard C++ not Game Programming. So I suggest that you rewrite your topic in Game Programming forum.

Regards...

آسفة اخي يعني بقسم الألعاب و الجرافيكس رايح تلاقي تفاعل مع موضوعك الكريم اكتر من خبراء الألعاب إن شاء الله. و السيناريو كمان بياخد وقت مش بمجرد القراءة...

Be patient please...

موفق يارب...

[وسط]

♥ Countess ♥

57899411.gif

♥

[/وسط]

#5

شكرا رغد على الرد أنا كتبت الموضوع هنا لأنه مطلوب تصميم اللعبة بلغة السي بلس بلس باستخدام Borland Builder

مواضيع مشابهة

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…