Remove (outdated) comments

This commit is contained in:
Sacha Ligthert 2023-12-11 20:49:07 +01:00
parent 1542837738
commit 64e20f36f2
2 changed files with 1 additions and 32 deletions

10
game.go
View File

@ -19,11 +19,6 @@ func gameinit() {
// Quit the screen
quit(&game)
// fmt.Println("\nDebug time: Trash")
// for i, t := range game.trash {
// fmt.Println("Trash: ", i, t)
// }
// Give closure
if game.gameover == 1 {
fmt.Println("\nYou got rekt by a robot")
@ -66,9 +61,7 @@ func initialize() (Game, error) {
moves: 0,
teleports: 0,
},
level: 1,
// robots: []Robot, // I need this maybe
// trash: []Position, // I will need this
level: 1,
gameover: 0,
}
@ -168,7 +161,6 @@ func (game *Game) keyboardProcessor() {
}
func quit(game *Game) {
// game.screen.Clear()
maybePanic := recover()
game.screen.Fini()
if maybePanic != nil {

View File

@ -85,31 +85,8 @@ func (game *Game) onRobot(robot Robot) bool {
return found
}
// TODO: improve this
func (game *Game) deleteRobot(robot Robot) {
// The following would work, if it wasn't for the fact you are iterating through an array,
// and deleting elements form that same array. So deleting item #15 isn't going to work
// when the array has been reduced to 13 elements.
// if robot < len(game.robots) {
// game.robots = append(game.robots[:robot], game.robots[robot+1:]...)
// }
// This isn't going to work for the same reason,
// and it adds the issue that random robots will get deleted.
// var rowboz []Position
// for i, r := range game.robots {
// if robot != i {
// rowboz = append(rowboz, r)
// }
// }
// game.robots = nil
// game.robots = rowboz
// Conclusion: I need to find a different way to do this properly while iterating to that same array.
var rowboz []Robot
for _, r := range game.robots {