Try my new website:
www.urcho.com
- the new SIMPLE social network
Sign up
|
287
members |
114
snippets
Search for:
ALL
POPULAR
File Controls
Multiplayer Code
2D Effects
3D Effects
Oldskool demos
Basic Functions
Maths/Physics
Sound
Tutorials
Misc
Username:
Password:
Sign up
Mouse and WASD control
[
back
]
Author:
Diablo
| Viewed:
705
times | Language:
BlitzBasic 3D
| Category:
Misc
Function mouselook(ent,mov#=1,Mode=1) mxspd#=MouseXSpeed()*0.25 myspd#=MouseYSpeed()*0.25 MoveMouse GraphicsWidth()/2,GraphicsHeight()/2 campitch#=EntityPitch(ent)+myspd# If campitch#<-85 Then campitch#=-85 If campitch#>85 Then campitch#=85 RotateEntity ent,campitch#,EntityYaw(ent)-mxspd#,EntityRoll(ent) If Mode=1 If KeyDown(17) MoveEntity ent,0,0,mov If KeyDown(31) MoveEntity ent,0,0,-mov If KeyDown(32) MoveEntity ent,mov,0,0 If KeyDown(30) MoveEntity ent,-mov,0,0 ElseIf Mode=3 If KeyDown(200) MoveEntity ent,0,0,1 If KeyDown(208) MoveEntity ent,0,0,-1 If KeyDown(205) MoveEntity ent,1,0,0 If KeyDown(203) MoveEntity ent,-1,0,0 If KeyDown(17) MoveEntity ent,0,0,mov If KeyDown(31) MoveEntity ent,0,0,-mov If KeyDown(32) MoveEntity ent,mov,0,0 If KeyDown(30) MoveEntity ent,-mov,0,0 If MouseDown(1) MoveEntity ent,0,0,mov If MouseDown(2) MoveEntity ent,0,0,-mov ElseIf Mode=2 If KeyDown(200) MoveEntity ent,0,0,1 If KeyDown(208) MoveEntity ent,0,0,-1 If KeyDown(205) MoveEntity ent,1,0,0 If KeyDown(203) MoveEntity ent,-1,0,0 EndIf End Function
Author Comments:
;Example While Not KeyHit(1) mouselook(camera,1,1) Wend
Login or
create an account
to comment on this snippet