[ Новые сообщения · Участники · Правила форума · Поиск · RSS ]


  • Страница 1 из 1
  • 1
Модератор форума: Spidy, turBO, blitz3d  
Форум мира Blitz3D » Язык Blitz3D » 3D программирование » Помогитеч, чем можете
Помогитеч, чем можете
AmigoДата: Вторник, 14.12.2010, 13:41 | Сообщение # 1
ламер
Группа: Пользователи
Сообщений: 7
Награды: 0
Репутация: 1
Статус: Offline
Игра по типу Вопро-ответ(Миллионер)...не получается сделать счётчик вопросов...нужно прицепить 2 подсказки и в конце сделать статистику(набранное кол-во очков)....(

raphics 800,600,0,2

SetBuffer BackBuffer()

HidePointer

backgroundimage = LoadImage("56.png")
mouseimage = LoadImage("mouseimage.png")

fntArial=LoadFont("Arial",24,False,False,False)
SetFont fntArial

Global a=0, b=0

filein = ReadFile("question.txt")
Read0$ = ReadLine( filein )
Read1$ = ReadLine( filein )
Read2$ = ReadLine$( filein )
Read3$ = ReadLine$( filein )
Read4$ = ReadLine$( filein )
ReadN$ = ReadLine( filein )
CloseFile( filein )

While Not KeyDown(1)

Cls

DrawImage backgroundimage, 0, 0

If a>0 Then a=a-1
If b>0 Then b=b-1

If a>0 Then
Color 250,240,130 : Text 340,0, "Правильно!"
End If

If b>0 Then
Color 255,10,10 : Text 340,0, "Не правильно!"
End If

Color 255,255,255
Text 12,300, Read0$

Color 50,200,50
Rect 10,330,350,30
Color 240,240,240
Rect 11,331,349,29
Color 20,20,20
Text 12,332, "1. "+Read1$

Color 50,200,50
Rect 10,400,350,30
Color 240,240,240
Rect 11,401,349,29
Color 20,20,20
Text 12,402, "2. "+Read2$

Color 50,200,50
Rect 400,330,350,30
Color 240,240,240
Rect 401,331,349,29
Color 20,20,20
Text 402,332, "3. "+Read3$

Color 50,200,50
Rect 400,400,350,30
Color 240,240,240
Rect 401,401,349,29
Color 20,20,20
Text 402,402, "4. "+Read4$

If MouseHit(1) Then
If RectsOverlap (10,330,350,30,MouseX() ,MouseY(),15,15) Then
If ReadN$="1" Then
a=20
Else
b=20
End If
End If
If RectsOverlap (10,400,350,30,MouseX() ,MouseY(),15,15) Then
If ReadN$="2" Then
a=20
Else
b=20
End If
End If
If RectsOverlap (400,330,350,30,MouseX() ,MouseY(),15,15) Then
If ReadN$="3" Then
a=20
Else
b=20
End If
End If
If RectsOverlap (400,400,350,30,MouseX() ,MouseY(),15,15) Then
If ReadN$="4" Then
a=20
Else
b=20
End If
End If
End If
Color 255,255,255
Text 0,2, "MouseX: " + MouseX()
Text 0,18, "MouseY: " + MouseY()
DrawImage mouseimage,MouseX(),MouseY()

Delay 20

Flip

Wend

 
Reks888Дата: Вторник, 14.12.2010, 15:34 | Сообщение # 2
ламер
Группа: Пользователи
Сообщений: 29
Награды: 1
Репутация: 4
Статус: Offline
А в чем проблема?
 
AmigoДата: Вторник, 14.12.2010, 15:48 | Сообщение # 3
ламер
Группа: Пользователи
Сообщений: 7
Награды: 0
Репутация: 1
Статус: Offline
проблема в том, что мне никак не удаётся сделать так, чтобы после ответа на вопрос он переходил к следующему..
 
turBOДата: Вторник, 14.12.2010, 20:28 | Сообщение # 4
Полковник
Группа: Администраторы
Сообщений: 297
Награды: 5
Репутация: 12
Статус: Offline
Держи часть1:
Code

Graphics 800,600,0,2

SetBuffer BackBuffer()

Global nquestion%=0
Global max_question%=2
;HidePointer

backgroundimage = LoadImage("56.png")
mouseimage = LoadImage("mouseimage.png")

fntArial=LoadFont("Arial",24,False,False,False)
SetFont fntArial

Global a=0, b=0

.marker1
nquestion=nquestion+1

filein = ReadFile("question"+nquestion+".txt")
Read0$ = ReadLine( filein )
Read1$ = ReadLine( filein )
Read2$ = ReadLine( filein )
Read3$ = ReadLine( filein )
Read4$ = ReadLine( filein )
right_answer$ = ReadLine( filein )
CloseFile( filein )

While Not KeyDown(1)
   
  Cls
   
  DrawImage backgroundimage, 0, 0
   
  If a>0 Then a=a-1
  If b>0 Then b=b-1
   
  If a>0 Then
   Color 250,240,130 : Text 340,0, "Правильно!"
  End If
   
  If b>0 Then
   Color 255,10,10 : Text 340,0, "Не правильно!"
  End If
   
  Color 255,255,255
  Text 12,300, Read0$
   
  Color 50,200,50
  Rect 10,330,350,30
  Color 240,240,240
  Rect 11,331,349,29
  Color 20,20,20
  Text 12,332, "1. "+Read1$
   
  Color 50,200,50
  Rect 10,400,350,30
  Color 240,240,240
  Rect 11,401,349,29
  Color 20,20,20
  Text 12,402, "2. "+Read2$
   


If 2+2<>4 Then Restart
 
turBOДата: Вторник, 14.12.2010, 20:30 | Сообщение # 5
Полковник
Группа: Администраторы
Сообщений: 297
Награды: 5
Репутация: 12
Статус: Offline
Часть2:
Code
Color 50,200,50
   Rect 10,400,350,30
   Color 240,240,240
   Rect 11,401,349,29
   Color 20,20,20
   Text 12,402, "2. "+Read2$
     
   Color 50,200,50
   Rect 400,330,350,30
   Color 240,240,240
   Rect 401,331,349,29
   Color 20,20,20
   Text 402,332, "3. "+Read3$
     
   Color 50,200,50
   Rect 400,400,350,30
   Color 240,240,240
   Rect 401,401,349,29
   Color 20,20,20
   Text 402,402, "4. "+Read4$
     
   If MouseHit(1) Then
    If RectsOverlap (10,330,350,30,MouseX() ,MouseY(),15,15) Then
     If right_answer="1" Then
      a=20
     Else
      b=20
     End If
    End If
    If RectsOverlap (10,400,350,30,MouseX() ,MouseY(),15,15) Then
     If right_answer="2" Then
      a=20
     Else
      b=20
     End If
    End If
    If RectsOverlap (400,330,350,30,MouseX() ,MouseY(),15,15) Then
     If right_answer="3" Then
      a=20
     Else
      b=20
     End If
    End If
    If RectsOverlap (400,400,350,30,MouseX() ,MouseY(),15,15) Then
     If right_answer="4" Then
      a=20
     Else
      b=20
     End If
    End If
   End If
   Color 255,255,255
   Text 0,2, "MouseX: " + MouseX()
   Text 0,18, "MouseY: " + MouseY()
   DrawImage mouseimage,MouseX(),MouseY()
     
   Delay 20
     
   Flip
     
   If a=20 Then   
    If nquestion=max_question Then
     End
    Else
     Goto marker1
    EndIf
   EndIf
     
Wend


If 2+2<>4 Then Restart
 
Форум мира Blitz3D » Язык Blitz3D » 3D программирование » Помогитеч, чем можете
  • Страница 1 из 1
  • 1
Поиск: