diff options
| author | Ray <raysan5@gmail.com> | 2016-02-20 01:09:47 +0100 |
|---|---|---|
| committer | Ray <raysan5@gmail.com> | 2016-02-20 01:09:47 +0100 |
| commit | 4b6e6d4dd45fc3a47b82af7eeb60871140a7eccf (patch) | |
| tree | d9ee679c3b0bc5d4a20b31930994deb0e4c37948 /examples/core_input_keys.c | |
| parent | f582ab06add085594f2579ee6e7d625212abd204 (diff) | |
| parent | 954ced21a42eb489ad382b4c00406a28778fee41 (diff) | |
| download | raylib-4b6e6d4dd45fc3a47b82af7eeb60871140a7eccf.tar.gz raylib-4b6e6d4dd45fc3a47b82af7eeb60871140a7eccf.zip | |
Merge pull request #83 from raysan5/develop
Develop branch integration
Diffstat (limited to 'examples/core_input_keys.c')
| -rw-r--r-- | examples/core_input_keys.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/core_input_keys.c b/examples/core_input_keys.c index 99d5e516..b2305246 100644 --- a/examples/core_input_keys.c +++ b/examples/core_input_keys.c @@ -20,7 +20,7 @@ int main() InitWindow(screenWidth, screenHeight, "raylib [core] example - keyboard input"); - Vector2 ballPosition = { screenWidth/2, screenHeight/2 }; + Vector2 ballPosition = { (float)screenWidth/2, (float)screenHeight/2 }; SetTargetFPS(60); // Set target frames-per-second //-------------------------------------------------------------------------------------- @@ -30,10 +30,10 @@ int main() { // Update //---------------------------------------------------------------------------------- - if (IsKeyDown(KEY_RIGHT)) ballPosition.x += 0.8; - if (IsKeyDown(KEY_LEFT)) ballPosition.x -= 0.8; - if (IsKeyDown(KEY_UP)) ballPosition.y -= 0.8; - if (IsKeyDown(KEY_DOWN)) ballPosition.y += 0.8; + if (IsKeyDown(KEY_RIGHT)) ballPosition.x += 0.8f; + if (IsKeyDown(KEY_LEFT)) ballPosition.x -= 0.8f; + if (IsKeyDown(KEY_UP)) ballPosition.y -= 0.8f; + if (IsKeyDown(KEY_DOWN)) ballPosition.y += 0.8f; //---------------------------------------------------------------------------------- // Draw |
