1 /* coded by Ketmar // Invisible Vector <ketmar@ketmar.no-ip.org>
2 * Understanding is not required. Only obedience.
4 * Based on the DOS Knightmare source code by Andrew Zabolotny
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, version 3 of the License ONLY.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 // ////////////////////////////////////////////////////////////////////////// //
19 // EnemySkeleton : BaseMovable
20 field int NumR, DX, State, DistX, DistY, DDY;
22 method(EnemySkeleton) void ctor (int apower) {
24 MyX = SpawnRandom(288)+16;
29 MyState = Klass.IAmBadGuy;
36 if (MyX > 156) DX = -SpawnRandom(2); else DX = SpawnRandom(2);
46 method(EnemySkeleton) void draw () {
48 putSprite("spr16x24_", 16+((TCount>>2)&1), MyX, MyY);
50 putSprite("spr16x16_", 24, MyX-DistX, MyY);
51 putSprite("spr16x16_", 25, MyX+DistX, MyY);
56 method(EnemySkeleton) void tick () {
57 if (MyY > 184) { NeedToDie = true; return; }
60 if (MyX < 4 || MyX > 320-16-4) DX = -DX;
65 CheckBalls(Klass.IAmShooted);
84 if (DDY >= 8) { State = 3; DDY = 15; }
89 if (DDY == 0) { State = 4; DDY = -5; }
96 if (DDY >= 6) { State = 1; DDY = -5; }