16.11.2007, 15:11
|
#13
|
Терабайт исходников
Регистрация: 05.07.2007
Сообщений: 5,196
Написано 1,721 полезных сообщений (для 5,374 пользователей)
|
Re: Боты - и всё что с ними связано.
Без глобала работать не хочет!
В чём проблема?

;--------------------------------------------------- { (T) - Bot
Type bot
Field entity
Field PS#
Field T#
End Type
;--------------------------------------------------- } (T) - Bot
; #############
;--------------------------------------------------- { (F) - Bot
Function create_bot(x#,y#,z#)
b.bot=New bot
b\entity=CreateSphere()
EntityColor b\entity,10,50,10
PositionEntity b\entity,x#,y#,z#
ScaleEntity b\entity,0.8,0.8,0.8
RotateMesh b\entity, 0, 180, 0
NameEntity b\entity,Handle(b)
b\PS#=0
b\T#=23
Return True
End Function
;--------------------------------------------------- } (F) - Bot
; #############
;--------------------------------------------------- { (F) - Bot Update
Function update_bot()
v#=0
For a.bot=Each bot
;---- Dobicha Polevogo Shpata {
If PS#=0 And T#=23 Then
PointEntity a\entity,Cube7
v#=0.1
End If
If EntityDistance(a\entity,Cube7)<1 And PS#<23 Then
v#=0.0
PS#=PS#+0.1
If PS#>23 Then PS#=23
If PS#=23 Then T#=0
End If
If PS#=23 Then
PointEntity a\entity,Cube4
v#=0.1
End If
If EntityDistance(a\entity,Cube4)<1 And PS#>0 Then
v#=0.0
PS#=0
T2#=1
End If
If EntityDistance(a\entity,Cube4)<1 And PS#=0 Then
T#=T#+0.1
If T#>23 Then T#=23
End If
;---- Dobicha Polevogo Shpata }
MoveEntity a\entity,0,0,v#
Next
End Function
;--------------------------------------------------- } (F) - Bot Update
|
|
(Offline)
|
|