Элита
Регистрация: 16.01.2010
Адрес: Новосибирск
Сообщений: 2,158
Написано 502 полезных сообщений (для 1,012 пользователей)
|
ошибка с типом

timer=timer+1
PositionEntity camera,EntityX(hero),EntityY(camera),EntityZ(hero)
PositionEntity hero,EntityX(hero),-.2,EntityZ(hero)
If Not (KeyDown(205) Or KeyDown(203))
If KeyDown(200) TranslateEntity hero,0,0,speed#:moveto=1;up
If KeyDown(208) TranslateEntity hero,0,0,-speed#:moveto=2;down
EndIf
If Not (KeyDown(208) Or KeyDown(200))
If KeyDown(205) TranslateEntity hero,speed#,0,0:moveto=3;right
If KeyDown(203) TranslateEntity hero,-speed#,0,0:moveto=4;left
EndIf
If (KeyDown(200) Or KeyDown(208) Or KeyDown(203) Or KeyDown(205))=0 moveto=0
Select moveto
Case 1
RotateEntity hero,0,0,0
piced=LinePick(EntityX(hero),0.5,EntityZ(hero),0,0,1)
Case 2
RotateEntity hero,0,180,0
piced=LinePick(EntityX(hero),0.5,EntityZ(hero),0,0,-1)
Case 3
RotateEntity hero,0,270,0
piced=LinePick(EntityX(hero),0.5,EntityZ(hero),1,0,0)
Case 4
RotateEntity hero,0,90,0
piced=LinePick(EntityX(hero),0.5,EntityZ(hero),-1,0,0)
End Select
speed=.1
If moveto=0 And AnimSeq(hero)<>nor Animate hero,1,1,nor;стоим
For a.map=Each map
If a\blok<>0;1 цикл***********************
;движения блока
If piced<>0
If piced=a\blok
If moveto<>0 And AnimSeq(hero)<>run_ Animate hero,1,1,run_
speed#=0.05
Select moveto
Case 1:TranslateEntity a\blok,0,0,speed
Case 2:TranslateEntity a\blok,0,0,-speed
Case 3:TranslateEntity a\blok,speed,0,0
Case 4:TranslateEntity a\blok,-speed,0,0
Case 4,3,2,1:
End Select
EndIf
Else
If moveto<>0 And AnimSeq(hero)<>run Animate hero,1,1,run
EndIf
If GetEntityType(a\blok)=but_t And a\stat=0
p=LinePick(EntityX(a\blok),-1,EntityZ(a\blok),0,3,0)
If p<>0
If GetEntityType(p)=blok_t
new_id%=a\chaild
a\stat=1
EndIf
EndIf
EndIf
If new_id%>0
If new_id%=a\id a\stat=1
EndIf
If a\stat=1 And GetEntityType(a\blok)=door_t And EntityY(a\blok)>-2 TranslateEntity a\blok,0,-.1,0
;EndIf
;Next
;For a.map=Each map
;If a\blok>0
If GetEntityType(a\blok)=bmb_t
TurnEntity a\blok,0,4,0
If EntityDistance(player,a\blok)<1
If bomb_c<10 FreeEntity a\blok:Delete a:bomb_c=bomb_c+5
If bomb_c>10 bomb_c=10
EndIf
EndIf
EndIf ;********************************* конец 1
Next
For b.Bomb=Each bomb
If b\stat=1
FreeEntity b\bomb_e
FreeEntity b\par:Delete b
Else
PositionEntity b\par,EntityX(b\bomb_e),EntityY(b\bomb_e)-.4,EntityZ(b\bomb_e)
If idcam=0 PointEntity b\par,cam_1
If idcam=1 PointEntity b\par,cam_2
EntityTexture b\par,part_tex,MilliSecs()/100 Mod 3
For a.map = Each map
If a\blok<>0
If GetEntityType(a\blok)=dwall_t And timer>b\timer
If EntityDistance(a\blok,b\bomb_e)<2.5 Then
FreeEntity a\blok:Delete a: b\stat=1
Else
b\stat=1
EndIf
EndIf
EndIf
Next
EndIf
Next
;ставим бомбы*********************************
If KeyHit(57) And Bomb_c>0
b.Bomb=New Bomb
b\bomb_e=CopyEntity(din_)
b\timer=timer+200
PositionEntity b\bomb_e,EntityX(hero),.7,EntityZ(hero)
ShowEntity b\bomb_e
bomb_c=bomb_c-1
b\stat=0
b\par=CopyEntity(part_sp)
EndIf;**************************************
(выделено красным)Там должн происходить плюсование количество динамита по 5,а плюсует в 2 раза больше,типо по типу в раз 2 прохода,но как??где косяк в этом коде(что весь код-Г*но сам знаю,но какой есть-такой есть)
|