Re: Changing Controls
Posted: September 1st, 2011, 1:16 pm
I am not using Lunix, so I had to do trial and error. I only got error.
No bad language. Kids must have parental permission!
http://forum.sandboxgamemaker.com/
Code: Select all
Index: src/engine/rendergl.cpp
===================================================================
--- src/engine/rendergl.cpp (revision 3240)
+++ src/engine/rendergl.cpp (working copy)
@@ -852,6 +852,9 @@
while(camera1->yaw>=360.0f) camera1->yaw -= 360.0f;
}
+int moveentropy = 0;
+VARP(mouselook, 0, 0, 1);
+
void mousemove(int dx, int dy)
{
float cursens = sensitivity, curaccel = mouseaccel;
@@ -880,13 +883,25 @@
}
camera1->yaw += dx*cursens;
- camera1->pitch -= dy*cursens;
+ if(mouselook)
+ camera1->pitch -= dy*cursens;
+ else
+ moveentropy = clamp<int>(500, -500, moveentropy - dy * cursens * 2);
+
fixcamerarange();
if(camera1!=player && !detachedcamera)
{
player->yaw = camera1->yaw;
player->pitch = camera1->pitch;
}
+
+ if(moveentropy)
+ {
+ player->move = clamp(1, -1, moveentropy);
+ int dt = min<int>(fabs(moveentropy), curtime);
+ moveentropy += (moveentropy > 0) ? -dt : dt;
+ }
+ else if(!mouselook) player->move = 0;
}
void recomputecamera()And used the appropriate programs? i.e. codeblocks and mingw?To compile go into src\windows and open the file named sandbox.cbp. This should start codeblocks.
if this is your first time, codeblocks will prompt you over which compiler to use, it should auto detect the presence of mingw under 'GNU compiler collection'. If not please make sure mingw is installed correctly.
To build the binaries, simply click the build button and codeblocks will take care of building everything.