-
Notifications
You must be signed in to change notification settings - Fork 1
/
up.pl
40 lines (36 loc) · 785 Bytes
/
up.pl
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
## external, moves player
$ScrollUp=2;
$ScrollDown=15;
$ScrollLeft=2; #5
$ScrollRight=20; #20
$map="";
$y=int($player{'z'}/$MapWide);
$x=$player{'z'}-($y*$MapWide);
$b1=substr($player{'map'},1,1);
if($b1 ge 'a'){
if($y){$y--;}else{$x=-1;}
}else{
if ($y>$ScrollUp) {
$y--;
} else {
## scroll up
do "loadmap.pl";
$a1=substr($player{'map'},0,1); $a1=chr(ord($a1)-1); if ($a1 lt 'A') { $a1=$MapEdgeY; }
$b2=chr(ord($b1)+1); if ($b2 gt $MapEdgeX) { $b2='0'; }
$a2=$a1;
$map4="$a1$b1";
$map5="$a2$b2";
$tileset4=&loadmap($map4);
$tileset5=&loadmap($map5);
$y=$y+$MapSizeY;
$player{'map'}="$a1$b1";
print "t4=$tileset4\n";
print "t5=$tileset5\n";
print "scroll=up\n";
}}
if($x>=0){
$player{'z'}=($y*$MapWide)+$x;
$TickObj.="u";
do "token.pl";
}
1;