diff --git a/src/App.vue b/src/App.vue index 633a5dfe4e547c48bfa93740a290ba5ba370930a..af89d0dd8d52f3853f23311b266f08af96b876fb 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,47 +1,76 @@ - - +const BALL_SIZE = 20; +const BAT_SIZE = 50; +let BAT_X = 0; +let BAT_Y = 0; +const SCORE_MAX = 100; +let score = 0; +let canvas = null; +let ctx = null; +onMounted(()=>{ + canvas = document.getElementById('canvas'); + ctx = canvas.getContext('2d'); + BAT_X = canvas.width - BAT_SIZE; + BAT_Y = canvas.height / 2 - BAT_SIZE / 2; + draw() +}) -