Im working on a basic FPS engine like Wolfenstine 3D or Doom. Im having some trouble with getting the alt and left key to work together so I can have strafing in the game. Anyone know how to do this.
cls
Make matrix 1,1000,1000,20,20
Load image "Tile.bmp",1
Prepare matrix texture 1,1,1,1
Fill matrix 1,0,1
hide mouse
sync rate 20
sync on
autocam off
turn camera right 45
load object "dmc.x", 1
i = 3
e = -3
load image "abg.bmp", 2
load image "smg.bmp", 3
load image "mgC.bmp", 4
load image "abg2.bmp", 5
make object plain 2, 20,20
texture object 2, 2
set object 2, 1,0,1
Fix object pivot 2
Scale object 2,20,20,0
position object 2,2,-1,5
Lock object on 2
hide object 2
make object plain 12, 20,20
texture object 12, 5
set object 12, 1,0,1
Fix object pivot 12
Scale object 12,20,20,0
position object 12,2,-1,5
Lock object on 12
hide object 12
make object plain 3, 40,40
texture object 3, 3
set object 3, 1,0,1
Fix object pivot 3
position object 3,8,-1,35
Lock object on 3
hide object 3
make object plain 4, 40,40
texture object 4, 4
set object 4, 1,0,1
Fix object pivot 4
position object 4,8,-1,35
Lock object on 4
hide object 4
Do
if leftkey()=1 then turn camera left 4
if rightkey()=1 then turn camera right 4
if upkey()=1 then move camera i
if downkey()=1 then move camera e
if keystate(42) then i=9:e=-9
if keystate(42)=false then i=3:e=-3
if keystate(2) then gosub _pistol
if keystate(3) then gosub _smg
if keystate(4) then gosub _minigun
if c = 1
if keystate(29) then show object 12
if keystate(29)=false then hide object 12
endif
sync
loop
_pistol:
c = 1
show object 2
hide object 3
hide object 4
return
_smg:
c = 2
show object 3
hide object 2
hide object 4
return
_minigun:
c = 3
show object 4
hide object 2
hide object 3
return
Comics and Games-Bread and Butter.