Бывалый
Регистрация: 03.12.2008
Адрес: наша раша
Сообщений: 762
Написано 129 полезных сообщений (для 245 пользователей)
|
Ответ: ограничение мышки по вертикали
вот я переделал...

Graphics3D 640,480
SetBuffer BackBuffer()
player = CreateSphere()
camera = CreateCamera(player)
PositionEntity camera,0,1.5,0
pol = CreateTerrain(32)
PositionEntity pol,0,-1,0
For x=1 To 10
cub = CreateCube()
PositionEntity cub,Rand(0,32),0,Rand(0,32)
EntityColor cub,Rand(0,255),Rand(0,255),Rand(0,255)
Next
MoveMouse GraphicsWidth()/2,GraphicsHeight()/2
While Not KeyDown(1)
x = MouseXSpeed()
y = MouseYSpeed()
xg = GraphicsWidth()/2
yg = GraphicsHeight()/2
If x<0 Then MoveMouse xg,yg
If x>0 Then MoveMouse xg,yg
If y<0 Then MoveMouse xg,yg
If y>0 Then MoveMouse xg,yg
TurnEntity player,0,-x,0
TurnEntity camera,y,0,0; вот я пытался зделать ограничение
limit = EntityPitch(camera,True)
If limit < -25 RotateEntity camera,-25,0,0
If limit >70 RotateEntity camera,70,0,0
If KeyDown(200) Then MoveEntity player,0,0,0.1
If KeyDown(208) Then MoveEntity player,0,0,-0.1
If KeyDown(203) Then MoveEntity player,-0.1,0,0
If KeyDown(205) Then MoveEntity player,0.1,0,0
UpdateWorld
RenderWorld
Text 10,10,limit
Flip
Wend
End
__________________
Reality Simulation Games
Core 2 Duo 2,8GHz, RAM 1Gb, ATI R5670 1Gb. WinXP 32
|