-
Notifications
You must be signed in to change notification settings - Fork 1
/
down.pl
42 lines (38 loc) · 925 Bytes
/
down.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
41
42
## external, moves player
$ScrollUp=2;
$ScrollDown=13;
$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<$MapHigh-1){$y++;}else{$x=-1;}
}else{
if ($y<$ScrollDown) {
$y++;
} else {
## scroll down
do "loadmap.pl";
$a1=substr($player{'map'},0,1); $a1=chr(ord($a1)+1); if ($a1 gt $MapEdgeY) { $a1="A"; }
$b2=chr(ord($b1)+1); if ($b2 gt $MapEdgeX) { $b2="0"; }
$a2=chr(ord($a1)+1); if ($a2 gt $MapEdgeY) { $a2="A"; }
$y=$y-$MapSizeY;
$player{'map'}="$a1$b1";
$map4="$a2$b1";
$map5="$a2$b2";
$tileset4=&loadmap($map4);
$tileset5=&loadmap($map5);
print "t4=$tileset4\n";
print "t5=$tileset5\n";
print "scroll=down\n";
$steps=1;
$form{'m'}=substr($form{'m'},0,1).".".substr($form{'m'},1);
}}
if($x>=0){
$player{'z'}=($y*$MapWide)+$x;
$TickObj.="d";
do "token.pl";
}
1;