source: 2011/26/JaakkoL/Rogue Agent 2372/Rogue Agent 2372/Rogue Agent 2372/Enemies.cs @ 2361

Revision 2361, 1.1 KB checked in by teeevasa, 10 years ago (diff)

added preliminary rifle support

Line 
1using System;
2using Jypeli;
3using Jypeli.Assets;
4using Jypeli.Controls;
5using Jypeli.Effects;
6using Jypeli.Widgets;
7
8public class MeleeAlien : GenCharacter
9{
10    const int speed = 100;
11    const int mass = 15;
12    Image portrait = Game.LoadImage("Images/basealien");
13    FollowerBrain brain;
14
15        public MeleeAlien(double width, double height, Shape shape, int HP, PhysicsObject target)
16        : base(width, height, shape, HP, target)
17        {
18        this.Image = portrait;
19        this.Tag = "MeleeAlien";
20        this.Mass = mass;
21
22        brain = new FollowerBrain();
23        this.Brain = brain;
24        brain.Target = target;
25        brain.Speed = speed;
26        brain.FollowAlways = true;
27        //brain.StopWhenTargetClose = true;
28        brain.TargetCloseDistance = 20;
29        }
30
31    private void closeToTarget(FollowerBrain senderBrain, EventArgs e)
32    {
33        senderBrain.Speed += 500;
34    }
35
36    public override void deathOccurred()
37    {
38        /*Explosion explosion = new Explosion(1000);
39        explosion.Position = this.Position;
40        Add(explosion);*/
41        this.Destroy();
42    }
43}
Note: See TracBrowser for help on using the repository browser.