Sorry, but its too long for a snippet. It's the beginning of my Action FPS rpg...
But this is what I'm trying to do:
Im trying to make it so in the loop, where you can move the character, its in Third Persons View, behind the Character and following the character. I have it like this, and when you hold control key you go into First Persons View while holding. I want it so you to go into First person view when you press control key, and don't have to hold it down. And then when you press control key again, it goes back to the Third Persons View. While this is happening, the game loop is happening (with shooting and everything).
This is a basic example (NOT intended to be compiled in darkbasic... just a read-through) :
Sync On
Do
rem HERE is where all the character movement goes.
rem ------------------------------------------------
rem Starting here is all the camera stuff
posx#=object position x(1)
posy#=object position y(1)
posz#=object position z(1)
position object 1,posx#,posy#,posz#
angle#=object angle y(1)
camdist#=5.0 : camhigh#=posy#+2.0 : camfade#=3
set camera to follow posx#,posy#,posz#,angle#,camdist#,camhigh#,camfade#,1
if controlkey()=1
circle mousex(),mousey(),4.30
position mouse 330,320
angle#=object angle y(1)
camdist#=-.50 : camhigh#=posy#+1.50 : camfade#=2
set camera to follow posx#,posy#,posz#,angle#,camdist#,camhigh#,camfade#,1
scale object 1,145,160,65
rem this is part of the shooting stuff
if mouseclick()=1
stage=2 : attack=attack+1
endif
endif
rem ------------------------------------------------
rem all the shooting stuff...
rem Syncronization baby!!!!
sync
loop
As you can see, this is what makes it so you have to hold control to go into first persons view... I want to be able to only have to press it once!