Dodany pierwszy gracz w calosci.
Teraz musze wymyslic sposob bym nie musial potwierdzac wyboru up/down
This commit is contained in:
parent
cfa61b69c4
commit
df3089dcbc
16
Pong.go
16
Pong.go
@ -17,17 +17,17 @@ var BallDirection [10][30]string
|
||||
var BallSpeed int
|
||||
var GameOver bool = false
|
||||
var LastPressedKey rune
|
||||
|
||||
func main() {
|
||||
SpawnEverything()
|
||||
}
|
||||
|
||||
func SpawnEverything() {
|
||||
CreateBoard()
|
||||
SpawnPlayers()
|
||||
SpawnBall()
|
||||
PrintBoard()
|
||||
Loop()
|
||||
|
||||
|
||||
}
|
||||
|
||||
func SpawnEverything() {
|
||||
}
|
||||
|
||||
func CreateBoard() {
|
||||
@ -49,25 +49,20 @@ func PrintBoard() {
|
||||
fmt.Print("\n")
|
||||
}
|
||||
}
|
||||
|
||||
func SpawnBall() {
|
||||
x = 4
|
||||
y = 14
|
||||
gameBoard[x][y] = "o"
|
||||
|
||||
}
|
||||
|
||||
func SpawnPlayers() {
|
||||
for i = 0; i < 10; i++ {
|
||||
Player1[i] = " "
|
||||
Player2[i] = " "
|
||||
}
|
||||
|
||||
for i = 3; i < 6; i++ {
|
||||
Player1[i] = "|"
|
||||
Player2[i] = "|"
|
||||
j = 0
|
||||
|
||||
gameBoard[i][0] = Player1[i]
|
||||
gameBoard[i][29] = Player2[i]
|
||||
}
|
||||
@ -83,7 +78,6 @@ func Loop() {
|
||||
gameBoard[P1index][0] = "|"
|
||||
gameBoard[P1index + 3][0] = " "
|
||||
PrintBoard()
|
||||
|
||||
} else {
|
||||
PrintBoard()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user