forked from Quasic/DragonBasher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathright.pl
41 lines (35 loc) · 933 Bytes
/
right.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
## external, moves player
$ScrollUp=2;
$ScrollDown=15;
$ScrollLeft=2; #5
$ScrollRight=20; #20
$map="";
$y=int($player{'z'}/$MapWide);
$x=$player{'z'}-($y*$MapWide);
if ($x<$ScrollRight) {
$x++; $player{'z'}=($y*$MapWide)+$x;
substr($player{'object'},3,1)="R";
} else {
## print "pop=scroll right\n";
do "loadmap.pl";
$a1=substr($player{'map'},0,1);
$b1=substr($player{'map'},1,1);
$b1=chr(ord($b1)+1); if ($b1 gt $MapEdgeX) { $b1="0"; }
$b2=chr(ord($b1)+1); if ($b2 gt $MapEdgeX) { $b2="0"; }
$a2=chr(ord($a1)+1); if ($a2 gt $MapEdgeY) { $a2="A"; }
$x=$x-$MapSizeX;
$player{'z'}=($y*$MapWide)+$x;
$player{'map'}="$a1$b1";
$map4="$a1$b2";
$map5="$a2$b2";
$tileset4=&loadmap($map4);
$tileset5=&loadmap($map5);
print "t4=$tileset4\n";
print "t5=$tileset5\n";
print "scroll=right\n";
$steps=1;
$form{'m'}=substr($form{'m'},0,1).".".substr($form{'m'},1);
}
$TickObj.="r";
do "token.pl";
1;