aboutsummaryrefslogtreecommitdiffstats
path: root/autoload/space_vlaze/player.vim
blob: e03cc242380ff5bdf5d3d8dc8cd22d90e9893ab0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
function! space_vlaze#player#PlayerCharacter()
	return '◆'
endfunction


function! space_vlaze#player#PlayerX()
	return s:PLAYER_X
endfunction


function! space_vlaze#player#SetPlayerX(player_x)
	let s:PLAYER_X = a:player_x
endfunction


function! space_vlaze#player#PlayerY()
	return s:PLAYER_Y
endfunction


function! space_vlaze#player#SetPlayerY(player_y)
	let s:PLAYER_Y = a:player_y
endfunction


function! space_vlaze#player#ClearPlayerCell()
	call space_vlaze#game#SetBoardCell(space_vlaze#player#PlayerY(), space_vlaze#player#PlayerX(), ' ')
endfunction


function! space_vlaze#player#MoveLeft()
	call space_vlaze#player#ClearPlayerCell()
	call space_vlaze#player#SetPlayerX(space_vlaze#player#PlayerX() - 1)
	call space_vlaze#game#SetBoardCell(space_vlaze#player#PlayerY(), space_vlaze#player#PlayerX(), space_vlaze#player#PlayerCharacter())
endfunction


function! space_vlaze#player#MoveDown()
	call space_vlaze#player#ClearPlayerCell()
	call space_vlaze#player#SetPlayerY(space_vlaze#player#PlayerY() + 1)
	call space_vlaze#game#SetBoardCell(space_vlaze#player#PlayerY(), space_vlaze#player#PlayerX(), space_vlaze#player#PlayerCharacter())
endfunction


function! space_vlaze#player#MoveUp()
	call space_vlaze#player#ClearPlayerCell()
	call space_vlaze#player#SetPlayerY(space_vlaze#player#PlayerY() - 1)
	call space_vlaze#game#SetBoardCell(space_vlaze#player#PlayerY(), space_vlaze#player#PlayerX(), space_vlaze#player#PlayerCharacter())
endfunction


function! space_vlaze#player#MoveRight()
	call space_vlaze#player#ClearPlayerCell()
	call space_vlaze#player#SetPlayerX(space_vlaze#player#PlayerX() + 1)
	call space_vlaze#game#SetBoardCell(space_vlaze#player#PlayerY(), space_vlaze#player#PlayerX(), space_vlaze#player#PlayerCharacter())
endfunction


function! space_vlaze#player#FireBlasters()
endfunction