Skip to content

Commit

Permalink
Changed length of inital snake to 3
Browse files Browse the repository at this point in the history
  • Loading branch information
sumershinde22 committed Nov 12, 2024
1 parent 4be6a17 commit eb2f338
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion NERODevelopment/content/Snake.qml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ Rectangle {
Component.onCompleted: startGame()

function startGame() {
snakeBody = [{ x: Math.floor(gridWidth / 2), y: Math.floor(gridHeight / 2) }]
let centerX = Math.floor(gridWidth / 2)
let centerY = Math.floor(gridHeight / 2)
snakeBody = [
{ x: centerX, y: centerY },
{ x: centerX - 1, y: centerY },
{ x: centerX - 2, y: centerY }
]
direction = 1
gameOver = false
score = 0
Expand Down

0 comments on commit eb2f338

Please sign in to comment.