| 
| df | Дата: Суббота, 16 Мая 2009, 19:26 | Сообщение # 1 |  |  Продвинутый Группа: Участники Сообщений: 144 Награды: 0 Замечания: 0% Статус:  
 Профессия: Программист Команда: Легион Темной Лисы(LDF) Проектов: 1 | И так для начала скажу что пытаюсь сделать.  Кто играл в RF? наверное помнит как идет создание перса(Выбор стороны,класс и нач. внешний вид) так вот я пытаюсь сделать что то аналагичное(не олнай, но подобие меню)
  Так вот мне предложили такой код 
 Code Graphics3D 800,600,32,2  
 Menu();Функция меню
 Function Menu();Функция меню
 
 font=LoadImage("menu/font.bmp")
 new_1=LoadImage("menu/new_1.bmp")
 load_1=LoadImage("menu/load_1.bmp")
 option_1=LoadImage("menu/option_1.bmp")
 autors_1=LoadImage("menu/autors_1.bmp")
 qeut_1=LoadImage("menu/qeut_1.bmp")
 
 Repeat
 
 If MouseHit(1)
 Select main_1
 Case 1
 Game();Функция игры
 Case 2
 LoadGame();Функция загрузки игры
 Case 3
 Options();Функция настроек
 Case 4
 Autors();Функция авторов
 Case 5
 Qute();Функция выхода из игры
 End
 End Select
 EndIf
 
 Cls
 
 DrawImage font,0,0
 
 main_1=0
 If RectsOverlap(MouseX(),MouseY(),1,1,40,395,140,20) main_1=1
 If RectsOverlap(MouseX(),MouseY(),1,1,40,420,190,20) main_1=2
 If RectsOverlap(MouseX(),MouseY(),1,1,40,445,150,20) main_1=3
 If RectsOverlap(MouseX(),MouseY(),1,1,40,470,170,20) main_1=4
 If RectsOverlap(MouseX(),MouseY(),1,1,580,560,200,20) main_1=5
 
 If main_1=1 DrawImage new_1,0,0
 If main_1=2 DrawImage load_1,0,0
 If main_1=3 DrawImage option_1,0,0
 If main_1=4 DrawImage autors_1,0,0
 If main_1=5 DrawImage qeut_1,0,0
 
 Color 250,200,0
 Text MouseX(),MouseY(),"*",True,True
 Flip
 Forever
 End Function
 
 Function Game();Функция игры
 
 End Function
 
 Function LoadGame();Функция загрузки игры
 fon=LoadFont("Arial",22,False,True,False)
 Repeat
 
 Flip
 Cls
 SetFont fon
 Color 255,0,255
 Text 0,0,"Игра в разработке,"
 Text 0,20,"Загрузка игры не возможна"
 Until KeyHit(1) Menu()
 End Function
 
 Function Options();Функция настроек
 option=LoadImage("options/option.bmp")
 graphic_1=LoadImage("options/graphic_1.bmp")
 input_1=LoadImage("options/input_1.bmp")
 audio_1=LoadImage("options/audio_1.bmp")
 back_1=LoadImage("options/back_1.bmp")
 
 Repeat
 If MouseHit(1)
 Select option_1
 Case 1
 Graphic();Функция графики
 Case 2
 Audio();Функция аудио
 Case 3
 Inpute();Функция управления
 Case 4
 Menu();Функция меню
 End
 End Select
 EndIf
 
 Cls
 DrawImage option,0,0
 option_1=0
 If RectsOverlap(MouseX(),MouseY(),1,1,40,395,105,20) option_1=1
 If RectsOverlap(MouseX(),MouseY(),1,1,40,445,70,20) option_1=2
 If RectsOverlap(MouseX(),MouseY(),1,1,40,420,150,20) option_1=3
 If RectsOverlap(MouseX(),MouseY(),1,1,680,560,80,20) option_1=4
 
 If option_1=1 DrawImage graphic_1,0,0
 If option_1=2 DrawImage audio_1,0,0
 If option_1=3 DrawImage input_1,0,0
 If option_1=4 DrawImage back_1,0,0
 
 Color 250,200,0
 Text MouseX(),MouseY(),"*",True,True
 Flip
 Forever
 End Function
 
 Function Autors();Функция авторов
 
 End Function
 
 Function Qute();Функция выхода из игры
 exit_fon=LoadImage("tex/exit_1.bmp")
 yes_1=LoadImage("tex/exit_2.bmp")
 no_1=LoadImage("tex/exit_3.bmp")
 Repeat
 
 If MouseHit(1)
 Select exit_g
 Case 1
 Exit
 Case 2
 Menu();Функция меню
 End
 End Select
 EndIf
 
 Cls
 DrawImage exit_fon,180,200
 
 exit_g=0
 If RectsOverlap(MouseX(),MouseY(),1,1,370,250,40,20) exit_g=1
 If RectsOverlap(MouseX(),MouseY(),1,1,360,300,60,20) exit_g=2
 
 If exit_g=1DrawImage yes_1,180,200
 If exit_g=2DrawImage no_1,180,200
 
 Color 250,200,0
 Text MouseX(),MouseY(),"*",True,True
 Flip
 Forever
 End Function
 
 ;Функции Настройки
 Function Graphic();Функция графики
 
 End Function
 
 Function Audio();Функция аудио
 
 End Function
 
 Function Inpute();Функция управления
 
 End Function
Как создать меню с кнопками и что бы задный фон был подвижным(и менялся при смене условия)(ну выбор стороны - два флага вокнутые в разрушеном пейзаж. при выпоре класа уже другой фон)?
  Вот такой код получился у меня 
 Code  Graphics3D 800,600,32,2
 SetBuffer BackBuffer()
 
 gw = GraphicsWidth()
 gh = GraphicsHeight()
 h = 90
 ho = gh - h
 
 Global fon
 Global camera
 
 Global cr_pers=0
 Global Rassa=0
 
 Global back_1
 Global back_2
 Global next_1
 Global next_2
 
 back_1=LoadImage("img/Back_1.png")
 back_2=LoadImage("img/Back_2.png")
 next_1=LoadImage("img/next_1.png")
 next_2=LoadImage("img/next_2.png")
 
 fon=LoadFont("Arial",22,False,True,False)
 
 camera=CreateCamera ()
 CameraClsColor camera,0,0,0
 PositionEntity camera,0,0,-4
 CameraRange camera,0.1,5000
 
 While Not KeyDown( 1 )
 
 Menu()
 
 UpdateWorld()
 RenderWorld()
 
 SetFont fon
 Text 0,0,main_1
 
 Flip
 Wend      ;Конец основного цикла
 End
 
 Function Menu()
 
 new_1=LoadImage("img/Server_1.png")
 new_2=LoadImage("img/Server_2.png")
 load_1=LoadImage("img/Load_1.png")
 load_2=LoadImage("img/Load_2.png")
 Qute_1=LoadImage("img/Exit_1.png")
 Qute_2=LoadImage("img/Exit_2.png")
 
 Repeat
 If MouseHit(1)
 Select main_1
 Case 1
 pers();Функция игры
 Case 2
 create_per_ximer();Функция загрузки игры
 End Select
 EndIf
 
 Cls
 
 DrawImage new_1,40,395
 DrawImage load_1,40,425
 DrawImage Qute_1,40,455
 
 main_1=0
 If RectsOverlap(MouseX(),MouseY(),1,1,40,395,180,30) main_1=1
 If RectsOverlap(MouseX(),MouseY(),1,1,40,425,180,30) main_1=2
 If RectsOverlap(MouseX(),MouseY(),1,1,40,455,180,30) main_1=3
 
 If main_1=1 DrawImage new_2,40,395
 If main_1=2 DrawImage load_2,40,425
 If main_1=3 DrawImage Qute_2,40,455
 Flip
 Forever
 End Function
 
 Function pers()
 
 create_1=LoadImage("img/Create_1.png")
 create_2=LoadImage("img/Create_2.png")
 back_1=LoadImage("img/Back_1.png")
 back_2=LoadImage("img/Back_2.png")
 
 Repeat
 If MouseHit(1)
 Select main_2
 Case 1
 create_per1();Функция игры
 Case 2
 Menu();Функция загрузки игры
 End
 End Select
 EndIf
 
 Cls
 
 DrawImage create_1,40,395
 DrawImage back_1,40,425
 
 main_2=0
 If RectsOverlap(MouseX(),MouseY(),1,1,40,395,180,30) main_2=1
 If RectsOverlap(MouseX(),MouseY(),1,1,40,425,180,30) main_2=2
 
 If main_2=1 DrawImage create_2,40,395
 If main_2=2 DrawImage back_2,40,425
 Flip
 Forever
 End Function
 
 Function create_per0()
 fon=LoadFont("Arial",22,False,True,False)
 
 main_3=0
 
 back_1=LoadImage("img/Back_1.png")
 back_2=LoadImage("img/Back_2.png")
 next_1=LoadImage("img/next_1.png")
 next_2=LoadImage("img/next_2.png")
 
 camera=CreateCamera ()
 CameraClsColor camera,0,0,0
 PositionEntity camera,0,0,-4
 CameraRange camera,0.1,5000
 
 ligt=CreateLight ()
 PositionEntity ligt,0,0,0
 
 homos=CreateCube ()
 PositionEntity homos, -4,0,4
 
 gros=CreateCube ()
 PositionEntity gros, -2,0,4
 gros_tex=LoadTexture ("Media\Img\rasa\Groser.jpg",4)
 EntityTexture gros,gros_tex
 
 Ximer=CreateCube ()
 PositionEntity ximer, 0,0,4
 ximer_tex=LoadTexture ("Media\Img\rasa\Ximer.jpg",4)
 EntityTexture ximer,ximer_tex
 
 Mexo=CreateCube ()
 PositionEntity Mexo, 2,0,4
 
 Energo=CreateCube ()
 PositionEntity Energo, 4,0,4
 Energo_tex=LoadTexture ("Media\Img\rasa\Energon.jpg")
 EntityTexture Energo,Energo_tex
 
 EntityPickMode homos,3
 EntityPickMode gros,3
 EntityPickMode Ximer,3
 EntityPickMode Mexo,3
 EntityPickMode Energo,3
 
 NameEntity homos, "homos"
 NameEntity gros, "gros"
 NameEntity Ximer, "Ximer"
 NameEntity Mexo, "Mexo"
 NameEntity Energo, "Energo"
 
 entity=0
 
 While create_pers=0
 
 EntityAlpha homos,0.5
 EntityAlpha gros,0.5
 EntityAlpha Ximer,0.5
 EntityAlpha Mexo,0.5
 EntityAlpha Energo,0.5
 
 x=MouseX()
 y=MouseY()
 
 If MouseHit(1) = True
 entity = CameraPick( camera,x,y)
 If entity
 name$ = EntityName(entity)
 If name = "homos"
 Rassa=1
 EndIf
 If name = "gros"
 Rassa=2
 EndIf
 If name = "Ximer"
 Rassa=3
 EndIf
 If name = "Mexo"
 Rassa=4
 EndIf
 If name = "Energo"
 Rassa=5
 EndIf
 EndIf
 EndIf
 
 If name = "homos"
 EntityAlpha homos,1
 EndIf
 If name = "gros"
 EntityAlpha gros,1
 EndIf
 If name = "Ximer"
 EntityAlpha Ximer,1
 EndIf
 If name = "Mexo"
 EntityAlpha Mexo,1
 EndIf
 If name = "Energo"
 EntityAlpha Energo,1
 EndIf
 
 e=CameraPick( camera,x,y)
 If e<>entity
 If entity Then EntityAlpha entity,0.9
 entity=e
 EndIf
 
 If entity
 EntityAlpha entity,1
 EndIf
 
 If Rassa=1 Then Rassa_t$="Люди"
 If Rassa=2 Then Rassa_t$="Гросеры"
 If Rassa=3 Then Rassa_t$="Химеры"
 If Rassa=4 Then Rassa_t$="Мехо"
 If Rassa=5 Then Rassa_t$="Энергоны"
 
 ;While cr_pers=0
 Repeat
 If MouseHit(1)
 Select main_3
 Case 1
 pers();Функция игры
 Case 2
 cr_pers=1
 create_per2();Функция загрузки игры
 End Select
 EndIf
 
 UpdateWorld()
 RenderWorld()
 
 Text 350,400,Rassa_t$
 Text 350,10,create_pers
 Text 10,10,Rassa
 
 Cls
 
 DrawImage back_1,100,550
 DrawImage next_1,500,550
 
 ;main_3=0
 If RectsOverlap(MouseX(),MouseY(),1,1,100,550,180,30) main_3=1
 If RectsOverlap(MouseX(),MouseY(),1,1,500,550,180,30) main_3=2
 
 If main_3=1 DrawImage back_2,100,550
 If main_3=2 DrawImage next_2,500,550
 
 Text 350,400,Rassa_t$
 Text 350,10,create_pers
 Text 10,10,Rassa
 
 Flip
 Forever
 Wend
 ;Wend
 ;End
 ;Cls
 ;Flip
 
 End Function
 
 Function create_per1()
 ;Repeat
 
 ligt=CreateLight ()
 PositionEntity ligt,0,0,0
 
 homos=CreateCube ()
 PositionEntity homos, -4,0,4
 
 gros=CreateCube ()
 PositionEntity gros, -2,0,4
 gros_tex=LoadTexture ("Media\Img\rasa\Groser.jpg",4)
 EntityTexture gros,gros_tex
 
 Ximer=CreateCube ()
 PositionEntity ximer, 0,0,4
 ximer_tex=LoadTexture ("Media\Img\rasa\Ximer.jpg",4)
 EntityTexture ximer,ximer_tex
 
 Mexo=CreateCube ()
 PositionEntity Mexo, 2,0,4
 
 Energo=CreateCube ()
 PositionEntity Energo, 4,0,4
 Energo_tex=LoadTexture ("Media\Img\rasa\Energon.jpg")
 EntityTexture Energo,Energo_tex
 
 EntityPickMode homos,3
 EntityPickMode gros,3
 EntityPickMode Ximer,3
 EntityPickMode Mexo,3
 EntityPickMode Energo,3
 
 NameEntity homos, "homos"
 NameEntity gros, "gros"
 NameEntity Ximer, "Ximer"
 NameEntity Mexo, "Mexo"
 NameEntity Energo, "Energo"
 
 While cr_pers=0
 
 If MouseHit(1)
 Select main_3
 Case 1
 pers();Функция игры
 Case 2
 cr_pers=1
 create_per2()
 End Select
 EndIf
 Flip
 Cls
 
 EntityAlpha homos,0.5
 EntityAlpha gros,0.5
 EntityAlpha Ximer,0.5
 EntityAlpha Mexo,0.5
 EntityAlpha Energo,0.5
 
 x=MouseX()
 y=MouseY()
 
 If MouseHit(1) = True
 entity = CameraPick( camera,x,y)
 If entity
 name$ = EntityName(entity)
 If name = "homos"
 Rassa=1
 EndIf
 If name = "gros"
 Rassa=2
 EndIf
 If name = "Ximer"
 Rassa=3
 EndIf
 If name = "Mexo"
 Rassa=4
 EndIf
 If name = "Energo"
 Rassa=5
 EndIf
 EndIf
 EndIf
 
 e=CameraPick( camera,x,y)
 If e<>entity
 If entity Then EntityAlpha entity,0.9
 entity=e
 EndIf
 
 If entity
 EntityAlpha entity,1
 EndIf
 
 If name = "homos"
 EntityAlpha homos,1
 EndIf
 If name = "gros"
 EntityAlpha gros,1
 EndIf
 If name = "Ximer"
 EntityAlpha Ximer,1
 EndIf
 If name = "Mexo"
 EntityAlpha Mexo,1
 EndIf
 If name = "Energo"
 EntityAlpha Energo,1
 EndIf
 
 If Rassa=1 Then Rassa_t$="Люди"
 If Rassa=2 Then Rassa_t$="Гросеры"
 If Rassa=3 Then Rassa_t$="Химеры"
 If Rassa=4 Then Rassa_t$="Мехо"
 If Rassa=5 Then Rassa_t$="Энергоны"
 
 UpdateWorld()
 RenderWorld()
 SetFont fon
 Text 350,400,Rassa_t$
 Text 350,10,create_pers
 Text 10,10,Rassa
 If Rassa<1 Then Text 250,20,"Выбирете расу персонажа"
 
 DrawImage back_1,100,550
 DrawImage next_1,500,550
 
 main_3=0
 If RectsOverlap(MouseX(),MouseY(),1,1,100,550,180,30) main_3=1
 If RectsOverlap(MouseX(),MouseY(),1,1,500,550,180,30) main_3=2
 
 If main_3=1 DrawImage back_2,100,550
 If main_3=2 DrawImage next_2,500,550
 
 
 Wend
 
 End Function
 
 Function create_per2()
 
 gros_fox=CreateCube ()
 PositionEntity gros_fox, -4,-2,4
 gros_wolf=CreateCube ()
 PositionEntity gros_wolf, -2,5,4
 gros_les_kat=CreateCube ()
 PositionEntity gros_les_kat, 0,1,4
 gros_arkt_kat=CreateCube ()
 PositionEntity gros_arkt_kat, 2,8,4
 gros_eshi=CreateCube ()
 PositionEntity gros_eshi, 4,5,4
 
 While cr_pers=3
 Flip
 Cls
 
 UpdateWorld()
 RenderWorld()
 SetFont fon
 Text 350,400,Rassa_t$
 Text 350,10,create_pers
 Text 10,10,Rassa
 ;Forever
 
 Wend
 
 End Function
 
 Function create_per_hom()
 ;Repeat
 
 gros_fox=CreateCube ()
 PositionEntity gros_fox, -4,-2,4
 gros_wolf=CreateCube ()
 PositionEntity gros_wolf, -2,5,4
 gros_les_kat=CreateCube ()
 PositionEntity gros_les_kat, 0,1,4
 gros_arkt_kat=CreateCube ()
 PositionEntity gros_arkt_kat, 2,8,4
 gros_eshi=CreateCube ()
 PositionEntity gros_eshi, 4,5,4
 
 While cr_pers=3
 Flip
 Cls
 
 UpdateWorld()
 RenderWorld()
 SetFont fon
 Text 350,400,Rassa_t$
 Text 350,10,create_pers
 Text 10,10,Rassa
 ;Forever
 
 Wend
 
 End Function
 
 Function create_per_gros()
 ;Repeat
 
 gros_fox=CreateCube ()
 PositionEntity gros_fox, -4,-2,4
 gros_wolf=CreateCube ()
 PositionEntity gros_wolf, -2,5,4
 gros_les_kat=CreateCube ()
 PositionEntity gros_les_kat, 0,1,4
 gros_arkt_kat=CreateCube ()
 PositionEntity gros_arkt_kat, 2,8,4
 gros_eshi=CreateCube ()
 PositionEntity gros_eshi, 4,5,4
 
 While cr_pers=2
 Flip
 Cls
 
 UpdateWorld()
 RenderWorld()
 ;Forever
 
 Wend
 
 End Function
 
 Function create_per_ximer()
 ;Repeat
 Flip
 Cls
 
 Ximer_fox=CreateCube ()
 PositionEntity Ximer_fox, -4,4,4
 tex_Ximer_fox=LoadTexture("Media\Img\rasa\pod_Ximer\Fox.PNG")
 EntityTexture Ximer_fox,tex_Ximer_fox
 
 gros_wolf=CreateCube ()
 PositionEntity gros_wolf, -2,4,4
 gros_les_kat=CreateCube ()
 PositionEntity gros_les_kat, 0,4,4
 gros_arkt_kat=CreateCube ()
 PositionEntity gros_arkt_kat, 2,4,4
 gros_eshi=CreateCube ()
 PositionEntity gros_eshi, 4,4,4
 
 While cr_pers=2
 
 UpdateWorld()
 RenderWorld()
 ;Forever
 Wend
 End Function
 
 Function Qute()
 End Function
 
 
Баг в том, что кода я нажимаю на "далее" после выбора расы(или же "Серве"(load_1) в меню) то получаю наслоение выбора(остается меню где мы вибираем расу и там же накладывается меню выбора подрасы(причем выбор подрасы не работает))
 
 
   
   |  |  |  |  | 
| 
| df | Дата: Воскресенье, 17 Мая 2009, 20:43 | Сообщение # 3 |  |  Продвинутый Группа: Участники Сообщений: 144 Награды: 0 Замечания: 0% Статус:  
 Профессия: Программист Команда: Легион Темной Лисы(LDF) Проектов: 1 | вот переправил 
 Code  Graphics3D 800,600,32,2
 SetBuffer BackBuffer()
 
 gw = GraphicsWidth()
 gh = GraphicsHeight()
 h = 90
 ho = gh - h
 
 Global fon
 Global camera
 
 Global cr=0
 Global cr_pers
 Global Rassa=0
 Global Rassa_t$
 Global PodRassa
 
 Global back_1
 Global back_2
 Global next_1
 Global next_2
 
 back_1=LoadImage("img/Back_1.png")
 back_2=LoadImage("img/Back_2.png")
 next_1=LoadImage("img/next_1.png")
 next_2=LoadImage("img/next_2.png")
 
 fon=LoadFont("Arial",22,False,True,False)
 
 camera=CreateCamera ()
 CameraClsColor camera,0,0,0
 PositionEntity camera,0,0,-4
 CameraRange camera,0.1,5000
 
 While Not KeyDown( 1 )
 
 Menu()
 
 UpdateWorld()
 RenderWorld()
 
 SetFont fon
 Text 0,0,main_1
 
 Flip
 Wend      ;Конец основного цикла
 End
 
 Function Menu()
 
 new_1=LoadImage("img/Server_1.png")
 new_2=LoadImage("img/Server_2.png")
 load_1=LoadImage("img/Load_1.png")
 load_2=LoadImage("img/Load_2.png")
 Qute_1=LoadImage("img/Exit_1.png")
 Qute_2=LoadImage("img/Exit_2.png")
 
 Repeat
 If MouseHit(1)
 Select main_1
 Case 1
 pers();Функция игры
 Case 2
 create_per_ximer();Функция загрузки игры
 End Select
 EndIf
 
 Cls
 
 DrawImage new_1,40,395
 DrawImage load_1,40,425
 DrawImage Qute_1,40,455
 
 main_1=0
 If RectsOverlap(MouseX(),MouseY(),1,1,40,395,180,30) main_1=1
 If RectsOverlap(MouseX(),MouseY(),1,1,40,425,180,30) main_1=2
 If RectsOverlap(MouseX(),MouseY(),1,1,40,455,180,30) main_1=3
 
 If main_1=1 DrawImage new_2,40,395
 If main_1=2 DrawImage load_2,40,425
 If main_1=3 DrawImage Qute_2,40,455
 Flip
 Forever
 End Function
 
 Function pers()
 
 create_1=LoadImage("img/Create_1.png")
 create_2=LoadImage("img/Create_2.png")
 back_1=LoadImage("img/Back_1.png")
 back_2=LoadImage("img/Back_2.png")
 
 Repeat
 If MouseHit(1)
 Select main_2
 Case 1
 create_per1();Функция игры
 Case 2
 Menu();Функция загрузки игры
 End
 End Select
 EndIf
 
 Cls
 
 DrawImage create_1,40,395
 DrawImage back_1,40,425
 
 main_2=0
 If RectsOverlap(MouseX(),MouseY(),1,1,40,395,180,30) main_2=1
 If RectsOverlap(MouseX(),MouseY(),1,1,40,425,180,30) main_2=2
 
 If main_2=1 DrawImage create_2,40,395
 If main_2=2 DrawImage back_2,40,425
 Flip
 Forever
 End Function
 
 Function create_per1()
 ;Repeat
 
 ligt=CreateLight ()
 PositionEntity ligt,0,0,0
 
 homos=CreateCube ()
 PositionEntity homos, -4,0,4
 
 gros=CreateCube ()
 PositionEntity gros, -2,0,4
 gros_tex=LoadTexture ("Media\Img\rasa\Groser.jpg",4)
 EntityTexture gros,gros_tex
 
 Ximer=CreateCube ()
 PositionEntity ximer, 0,0,4
 ximer_tex=LoadTexture ("Media\Img\rasa\Ximer.jpg",4)
 EntityTexture ximer,ximer_tex
 
 Mexo=CreateCube ()
 PositionEntity Mexo, 2,0,4
 
 Energo=CreateCube ()
 PositionEntity Energo, 4,0,4
 Energo_tex=LoadTexture ("Media\Img\rasa\Energon.jpg")
 EntityTexture Energo,Energo_tex
 
 EntityPickMode homos,3
 EntityPickMode gros,3
 EntityPickMode Ximer,3
 EntityPickMode Mexo,3
 EntityPickMode Energo,3
 
 NameEntity homos, "homos"
 NameEntity gros, "gros"
 NameEntity Ximer, "Ximer"
 NameEntity Mexo, "Mexo"
 NameEntity Energo, "Energo"
 
 While cr_pers<1
 
 Mhit=MouseHit(1)
 
 If Mhit
 Select main_3
 Case 1
 pers();Функция игры
 Case 2
 cr_pers=cr_pers+1
 create_per2()
 End Select
 EndIf
 
 Flip
 Cls
 
 EntityAlpha homos,0.5
 EntityAlpha gros,0.5
 EntityAlpha Ximer,0.5
 EntityAlpha Mexo,0.5
 EntityAlpha Energo,0.5
 
 x=MouseX()
 y=MouseY()
 
 If Mhit = True
 entity = CameraPick( camera,x,y)
 If entity
 name$ = EntityName(entity)
 If name = "homos"
 Rassa=1
 EndIf
 If name = "gros"
 Rassa=2
 EndIf
 If name = "Ximer"
 Rassa=3
 EndIf
 If name = "Mexo"
 Rassa=4
 EndIf
 If name = "Energo"
 Rassa=5
 EndIf
 EndIf
 EndIf
 
 e=CameraPick( camera,x,y)
 If e<>entity
 If entity Then EntityAlpha entity,0.9
 entity=e
 EndIf
 
 If entity
 EntityAlpha entity,1
 EndIf
 
 If name = "homos"
 EntityAlpha homos,1
 EndIf
 If name = "gros"
 EntityAlpha gros,1
 EndIf
 If name = "Ximer"
 EntityAlpha Ximer,1
 EndIf
 If name = "Mexo"
 EntityAlpha Mexo,1
 EndIf
 If name = "Energo"
 EntityAlpha Energo,1
 EndIf
 
 If Rassa=1 Then Rassa_t$="Люди"
 If Rassa=2 Then Rassa_t$="Гросеры"
 If Rassa=3 Then Rassa_t$="Химеры"
 If Rassa=4 Then Rassa_t$="Мехо"
 If Rassa=5 Then Rassa_t$="Энергоны"
 
 UpdateWorld()
 RenderWorld()
 SetFont fon
 Text 350,400,Rassa_t$
 Text 350,10,create_pers
 Text 10,10,Rassa
 Text 10,30,PodRassa
 If Rassa<1 Then Text 250,20,"Выбирете расу персонажа"
 
 DrawImage back_1,100,550
 DrawImage next_1,500,550
 
 main_3=0
 If RectsOverlap(MouseX(),MouseY(),1,1,100,550,180,30) main_3=1
 If RectsOverlap(MouseX(),MouseY(),1,1,500,550,180,30) main_3=2
 
 If main_3=1 DrawImage back_2,100,550
 If main_3=2 DrawImage next_2,500,550
 
 
 Wend
 
 End Function
 
 Function create_per2()
 
 ligt=CreateLight ()
 PositionEntity ligt,0,0,0
 
 Ximer_fox=CreateCube ()
 PositionEntity Ximer_fox, -4,4,4
 tex_Ximer_fox=LoadTexture("Media\Img\rasa\pod_Ximer\Fox.PNG")
 EntityTexture Ximer_fox,tex_Ximer_fox
 
 Ximer_wolf=CreateCube ()
 PositionEntity Ximer_wolf, -2,4,4
 Ximer_les_kat=CreateCube ()
 PositionEntity Ximer_les_kat, 0,4,4
 Ximer_arkt_kat=CreateCube ()
 PositionEntity Ximer_arkt_kat, 2,4,4
 Ximer_eshi=CreateCube ()
 PositionEntity Ximer_eshi, 4,4,4
 
 EntityPickMode Ximer_fox,3
 EntityPickMode Ximer_wolf,3
 EntityPickMode Ximer_les_kat,3
 EntityPickMode Ximer_arkt_kat,3
 EntityPickMode Ximer_eshi,3
 
 NameEntity Ximer_fox, "X_fox"
 NameEntity Ximer_wolf, "X_wolf"
 NameEntity Ximer_les_kat, "X_les_kat"
 NameEntity Ximer_arkt_kat, "X_art_kat"
 NameEntity Ximer_eshi, "X_eshi"
 
 While cr_pers1<2
 Mhit1=MouseHit(1)
 
 Flip
 Cls
 
 EntityAlpha Ximer_fox,0.5
 EntityAlpha Ximer_wolf,0.5
 EntityAlpha Ximer_les_kat,0.5
 EntityAlpha Ximer_arkt_kat,0.5
 EntityAlpha Ximer_eshi,0.5
 
 x1=MouseX()
 y1=MouseY()
 
 If Mhit1 = True
 entity = CameraPick( camera,x1,y1)
 If entity
 name$ = EntityName(entity)
 If name = "X_fox"
 PodRassa=1
 EndIf
 If name = "X_wolf"
 PodRassa=2
 EndIf
 If name = "X_les_kat"
 PodRassa=3
 EndIf
 If name = "X_art_kat"
 PodRassa=4
 EndIf
 If name = "X_eshi"
 PodRassa=5
 EndIf
 EndIf
 EndIf
 
 e=CameraPick( camera,x,y)
 If e<>entity
 If entity Then EntityAlpha entity,0.9
 entity=e
 EndIf
 
 If entity
 EntityAlpha entity,1
 EndIf
 
 If name = "X_fox"
 EntityAlpha Ximer_fox,1
 EndIf
 If name = "X_wolf"
 EntityAlpha Ximer_wolf,1
 EndIf
 If name = "X_les_kat"
 EntityAlpha Ximer_les_kat,1
 EndIf
 If name = "X_art_kat"
 EntityAlpha Ximer_arkt_kat,1
 EndIf
 If name = "X_eshi"
 EntityAlpha Ximer_eshi,1
 EndIf
 
 UpdateWorld()
 RenderWorld()
 Text 350,400,Rassa_t$
 Text 350,10,create_pers
 Text 10,10,Rassa
 Text 10,30,PodRassa
 ;Forever
 
 Wend
 
 End Function
 
 Function create_per_hom()
 ;Repeat
 
 gros_fox=CreateCube ()
 PositionEntity gros_fox, -4,-2,4
 gros_wolf=CreateCube ()
 PositionEntity gros_wolf, -2,5,4
 gros_les_kat=CreateCube ()
 PositionEntity gros_les_kat, 0,1,4
 gros_arkt_kat=CreateCube ()
 PositionEntity gros_arkt_kat, 2,8,4
 gros_eshi=CreateCube ()
 PositionEntity gros_eshi, 4,5,4
 
 While cr_pers=3
 Flip
 Cls
 
 UpdateWorld()
 RenderWorld()
 SetFont fon
 Text 350,400,Rassa_t$
 Text 350,10,create_pers
 Text 10,10,Rassa
 ;Forever
 
 Wend
 
 End Function
 
 Function create_per_gros()
 ;Repeat
 
 gros_fox=CreateCube ()
 PositionEntity gros_fox, -4,-2,4
 gros_wolf=CreateCube ()
 PositionEntity gros_wolf, -2,5,4
 gros_les_kat=CreateCube ()
 PositionEntity gros_les_kat, 0,1,4
 gros_arkt_kat=CreateCube ()
 PositionEntity gros_arkt_kat, 2,8,4
 gros_eshi=CreateCube ()
 PositionEntity gros_eshi, 4,5,4
 
 While cr_pers=2
 Flip
 Cls
 
 UpdateWorld()
 RenderWorld()
 ;Forever
 
 Wend
 
 End Function
 
 Function create_per_ximer()
 ;Repeat
 Flip
 Cls
 
 Ximer_fox=CreateCube ()
 PositionEntity Ximer_fox, -4,4,4
 tex_Ximer_fox=LoadTexture("Media\Img\rasa\pod_Ximer\Fox.PNG")
 EntityTexture Ximer_fox,tex_Ximer_fox
 
 gros_wolf=CreateCube ()
 PositionEntity gros_wolf, -2,4,4
 gros_les_kat=CreateCube ()
 PositionEntity gros_les_kat, 0,4,4
 gros_arkt_kat=CreateCube ()
 PositionEntity gros_arkt_kat, 2,4,4
 gros_eshi=CreateCube ()
 PositionEntity gros_eshi, 4,4,4
 
 While cr_pers=2
 UpdateWorld()
 RenderWorld()
 Wend
 End Function
 
 Function Qute()
 End Function
 
 Да собсто теперь все работает только вот новый баг.   При переходе к подрасе(create_per2()) остается create_per1()(причем можно выберать, но значение не меняется и не становися прозрацным) 
 Quote а после нажатия кнопки далее всё возвращается в цикл функции pers() т.к cr_pers <> 0 то в этом цикле и остается, где там подрасса, я так и не увидели как кстате сделать остановку цикла
  и еше забыл сказать в начале видимо; Что некоторые расы не имеею подвида(ну homos(люди)) и нужно переходить к параметрам, и как мне сделать следуюший выбор в зависимости от выбора. (ну сторны. в одной есть раса в другой её нема) 
 
   
   |  |  |  |  |