MCPcopy Create free account
hub / github.com/RobLoach/raylib-cpp / Update

Method Update

examples/textures/textures_bunnymark.cpp:32–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30 }
31
32 void Update(const raylib::Texture2D& texBunny) {
33 position.x += speed.x;
34 position.y += speed.y;
35
36 if (((position.x + texBunny.width/2) > GetScreenWidth()) ||
37 ((position.x + texBunny.width/2) < 0)) speed.x *= -1;
38 if (((position.y + texBunny.height/2) > GetScreenHeight()) ||
39 ((position.y + texBunny.height/2 - 40) < 0)) speed.y *= -1;
40 }
41
42 Vector2 position;
43 Vector2 speed;

Callers 1

mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected