summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/Paddle.h
diff options
context:
space:
mode:
authorKieran Cawthray <kieranc@gmail.com>2021-07-12 13:01:11 +0200
committerKieran Cawthray <kieranc@gmail.com>2021-07-12 13:01:11 +0200
commitdb99ac88d9b10a1a0f81291c171d5bafdf08fe0e (patch)
tree9bfa74096cff8a4f8cd08edbda01b7c0978b3bed /src/displayapp/screens/Paddle.h
parent2edf41be8eea79461a1f9b45a16d13f150c7e5d5 (diff)
parent4f378e8726fdcff72598aa6ed12eeaa6b3e61355 (diff)
Merge remote-tracking branch 'upstream/develop' into pinetimestyle-colorpicker
Diffstat (limited to 'src/displayapp/screens/Paddle.h')
-rw-r--r--src/displayapp/screens/Paddle.h22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/displayapp/screens/Paddle.h b/src/displayapp/screens/Paddle.h
index e133244f..30ab8f94 100644
--- a/src/displayapp/screens/Paddle.h
+++ b/src/displayapp/screens/Paddle.h
@@ -24,24 +24,22 @@ namespace Pinetime {
private:
Pinetime::Components::LittleVgl& lvgl;
- int paddleBottomY = 90; // bottom extreme of the paddle
- int paddleTopY = 150; // top extreme of the paddle
+ const uint8_t ballSize = 16;
- int ballX = 107; // Initial x_coordinate for the ball (12px offset from the center to counteract the ball's 24px size)
- int ballY = 107; // Initial y_coordinate for the ball
+ uint16_t paddlePos = 30; // Paddle center
- int dx = 2; // Velocity of the ball in the x_coordinate
- int dy = 3; // Velocity of the ball in the y_coordinate
+ int16_t ballX = (LV_HOR_RES - ballSize) / 2;
+ int16_t ballY = (LV_VER_RES - ballSize) / 2;
- int counter = 0; // init Frame refresh limit counter
- int score = 0;
+ int8_t dx = 2; // Velocity of the ball in the x_coordinate
+ int8_t dy = 3; // Velocity of the ball in the y_coordinate
- lv_img_dsc_t paddle;
- lv_img_dsc_t ball;
+ uint16_t score = 0;
lv_obj_t* points;
- lv_obj_t* paddle_image; // pointer to paddle image
- lv_obj_t* ball_image; // pointer to ball image
+ lv_obj_t* paddle;
+ lv_obj_t* ball;
+ lv_obj_t* background;
};
}
}