Тема: Ошибка
Показать сообщение отдельно
Старый 14.07.2015, 14:22   #4
softcrasoft
Знающий
 
Регистрация: 21.03.2015
Сообщений: 262
Написано 6 полезных сообщений
(для 7 пользователей)
Ответ: Ошибка

передалал немного код, тоже самое начало появлятся. знак я не указывал
Type Entity
Field hp
Field mesh
Field name$
End Type
Graphics3D 1366,768,16,2
SetBuffer BackBuffer()
Const G#=1
Const typeplayer=1
Const typeterr=2
player=CreateSphere()
cam=CreateCamera(player)
EntityType player,typeplayer
terrain=CreatePlane()
EntityType terrain,typeterr
Collisions typeplayer,typeterr,2,3
CreateListener(cam)
sound=Load3DSound("1.wav")
strelba = LoadSound ("snd\m107.mp3")
hp = LoadSound("snd\16_Lastlife.wav")
ranenie = LoadSound("snd\die1.wav")
ubit = LoadSound("snd\scream_21.wav")
For i=1 To 10
bot.Entity=New Entity
bot\hp = 100
bot\name = Handle(bot)
bot\mesh = CreateCube()
NameEntity*bot\mesh,*bot\name
PositionEntity bot\mesh,Rnd(0,50),0,50
EntityPickMode bot\mesh,3
Next
While Not KeyHit(1)
TurnEntity cam,MouseYSpeed(),0,0
TurnEntity player,0,-MouseXSpeed(),0
TranslateEntity player,0,-G#,0
ent=CameraPick(cam,MouseX(),MouseY())
If KeyHit(2 Then
PlaySound strelba
If ent <> 0 Then
bot.Entity=Object.Entity(EntityName(ent))
bot\hp=bot\hp-10
If bot\hp > 10 PlaySound ranenie
If bot\hp <= 0 Then
PlaySound ubit
FreeEntity bot\mesh
End If
End If
End If
If KeyHit(30) EmitSound(sound,bot\mesh)
If KeyHit(201) MoveEntity player,0,0,0.5
If KeyHit(20 MoveEntity player,0,0,-0.5
If KeyHit(203) TurnEntity player,0,1,0
If KeyHit(205) TurnEntity player,0,-1,0
MoveMouse GraphicsWidth()*0.5,GraphicsHeight()*0.5
If Abs(EntityPitch#(cam))>70 RotateEntity cam,70*Sgn(EntityPitch#(cam)),0,0
UpdateWorld()
RenderWorld()
Flip
Wend
End
изменил If KeyHit(30) EmitSound(sound,bot\mesh) было не правильно указано названия переменных.
(Offline)
 
Ответить с цитированием