| 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; |