Показать сообщение отдельно
Старый 05.03.2007, 07:37   #2
moka
.
 
Регистрация: 05.08.2006
Сообщений: 10,429
Написано 3,454 полезных сообщений
(для 6,863 пользователей)
Re: типы в блитзе

[blitz]
Type Bot ;Massiv Bota
Field Entity ;Sfera
Field Life% ;Zdorovje
End Type

Graphics3D 1024,768,32,2
SetBuffer BackBuffer()
Global zdorov=100

Const pl=1,bott=2
SeedRnd MilliSecs()

l = CreateLight()
RotateEntity l, 0, 45, 0
PositionEntity l,0,51,0

pla=CreatePlane()
ScaleEntity pla, 1000, 1, 1000
PositionEntity pla,0,0,0
EntityColor pla,0,255,0

Player=CreateCube()
PositionEntity player ,15,3,15
EntityColor player,255,0,0
EntityType player,pl
cam= CreateCamera(player)
PositionEntity cam,0,5,-10

For n=1 to 5 ;Sdelatj Patj Raz
b.Bot=New Bot ;Novij element v massiv
b\Entity=CreateSphere() ;Sozdajom Sfery
PositionEntity b\Entity ,15,3,30
EntityColor b\Entity,0,0,255
EntityType b\Entity,bott
Next

Collisions pl,bott,1,2

Repeat

If KeyDown(200) MoveEntity Player,0,0,1
If KeyDown(205) TurnEntity Player,0,-3,0
If KeyDown(203) TurnEntity Player,0,3,0

For b.Bot=Each Bot ;Dlja vsego massiva
If EntityCollided(b\Entity,pl) ;Jesli kollizitsja sfera s playerom
If KeyHit(57) ;Jesli nazhat SPace
b\Life=b\Life-Rnd(40,60) ;Otnimajem Zhizni
EndIf
EndIf
If b\Life<=0 ;Jesli zhizni malo
FreeEntity b\Entity ;Ydalajem Sfery
Delete b ;Ydalajem Massiv
Endif
Next

UpdateWorld
RenderWorld
Flip
Until KeyHit(1)
End
[/blitz]

Вродебы всё прально, писал в броузере.
(Offline)
 
Ответить с цитированием