aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2015-10-07 02:35:22 -0400
committerTeddy Wing2015-10-07 02:35:22 -0400
commit8c808568f9d1087e1146d281bb3a63b543b43108 (patch)
treec86fce2ae59f7db460c3a0ee7d2cf8db4db144a4
parente2a889845f32a6f8538038d398a6fc8a0a17576e (diff)
downloadvim-space-vlaze-8c808568f9d1087e1146d281bb3a63b543b43108.tar.bz2
enemy.vim: Add descriptive comment to DropEnemyAtRandomCoordinates
Explain the while loop and condition here better than the code explains it.
-rw-r--r--autoload/space_vlaze/enemy.vim1
1 files changed, 1 insertions, 0 deletions
diff --git a/autoload/space_vlaze/enemy.vim b/autoload/space_vlaze/enemy.vim
index 377c803..51bf14d 100644
--- a/autoload/space_vlaze/enemy.vim
+++ b/autoload/space_vlaze/enemy.vim
@@ -43,6 +43,7 @@ function! space_vlaze#enemy#DropEnemyAtRandomCoordinates()
let y = player_y
let x = player_x
+ " Don't drop enemy at the same coordinates as the player
while player_y ==# y && player_x ==# x
let y = space_vlaze#random#Random(space_vlaze#game#BoardHeight() - 1)
let x = space_vlaze#random#Random(space_vlaze#game#BoardWidth() - 1)