@@ -2040,12 +2040,89 @@ www
2040
2040
);
2041
2041
}
2042
2042
2043
+ sub add_sword_fish {
2044
+ my ($old_end , $anim ) = @_ ;
2045
+
2046
+ my @sword_fish_image = (
2047
+ q{
2048
+ )",
2049
+ _ /\\\\\\\\
2050
+ ", _____,,,,,--\\\\\\\\\\\\)
2051
+ \\\\ ,,;_______\\\\\\\\\\----""";_
2052
+ )\\_.-'`"""""......-------------,o";__________
2053
+ ==.-.,____ """;;;;,__._.=='""
2054
+ )\\ " "\\""---;...,______:.-"
2055
+ // ")_.-` _.-'
2056
+ _.' _.-'
2057
+ } ,
2058
+ q{
2059
+ ,"(
2060
+ ////\ _
2061
+ (//////--,,,,,_____ ,"
2062
+ _;"""----/////_______;,, //
2063
+ __________;"o,-------------......"""""`'-._/(
2064
+ ""'==._.__,;;;;""" ____,.-.==
2065
+ "-.:______,...;---""/" " \\(
2066
+ '-._ `-._(" \\\\
2067
+ '-._ '._
2068
+ } );
2069
+
2070
+ my @sword_fish_mask = (
2071
+ q{
2072
+ 222
2073
+ 6 22222
2074
+ 66 2222222222222222222
2075
+ 66 111111111111111111111111
2076
+ 666111111111111111111111111111144455555555555
2077
+ 6661111111 111777711111155555
2078
+ 66 1 11111111111111111111111
2079
+ 66 3333333 3333
2080
+ 666 3333
2081
+ } ,
2082
+ q{
2083
+ 222
2084
+ 22222 6
2085
+ 2222222222222222222 66
2086
+ 111111111111111111111111 66
2087
+ 555555555554441111111111111111111111111111666
2088
+ 555551111117777111 1111111666
2089
+ 11111111111111111111111 1 66
2090
+ 3333 3333333 66
2091
+ 3333 666
2092
+ } );
2093
+
2094
+ my $dir = int (rand (2));
2095
+ my $x ;
2096
+ my $speed = 3.5;
2097
+ if ($dir ) {
2098
+ $x = $anim -> width()-1;
2099
+ $speed *= -1;
2100
+ } else {
2101
+ $x = -33;
2102
+ }
2103
+ my $max_height = 9;
2104
+ my $min_height = $anim -> height() - 14;
2105
+ my $y = int (rand ($min_height - $max_height )) + $max_height ;
2106
+ my $color_mask = rand_color($sword_fish_mask [$dir ]);
2107
+ $anim -> new_entity(
2108
+ shape => $sword_fish_image [$dir ],
2109
+ auto_trans => 1,
2110
+ color => $color_mask ,
2111
+ position => [ $x , $y , $depth {' shark' } ],
2112
+ callback_args => [ $speed , 0, 0 ],
2113
+ death_cb => \&random_object,
2114
+ die_offscreen => 1,
2115
+ default_color => ' YELLOW' ,
2116
+ );
2117
+ }
2118
+
2043
2119
sub init_random_objects {
2044
2120
return (
2045
2121
\&add_ship,
2046
2122
\&add_whale,
2047
2123
\&add_monster,
2048
2124
\&add_big_fish,
2125
+ \&add_sword_fish,
2049
2126
\&add_shark,
2050
2127
\&add_submarine,
2051
2128
\&add_fishhook,
0 commit comments