Line | |
---|
1 | using System; |
---|
2 | using Jypeli; |
---|
3 | using Jypeli.Assets; |
---|
4 | using Jypeli.Controls; |
---|
5 | using Jypeli.Effects; |
---|
6 | using Jypeli.Widgets; |
---|
7 | |
---|
8 | public class Pistol : Weapon |
---|
9 | { |
---|
10 | public Pistol(double width, double height) |
---|
11 | : base(width, height) |
---|
12 | { |
---|
13 | Image = Game.LoadImage("Images/gausspistol"); |
---|
14 | AttackSound = Game.LoadSoundEffect("Sounds/pistolshot"); |
---|
15 | AmmoIgnoresGravity = true; |
---|
16 | InfiniteAmmo = true; |
---|
17 | Power.DefaultValue = 800; |
---|
18 | TimeBetweenUse = TimeSpan.FromSeconds(0.4); |
---|
19 | } |
---|
20 | |
---|
21 | protected override PhysicsObject CreateProjectile() |
---|
22 | { |
---|
23 | Projectile proj = new Projectile(1, 1, Color.DarkGray); |
---|
24 | proj.CollisionIgnoreGroup = 1; |
---|
25 | return proj; |
---|
26 | } |
---|
27 | |
---|
28 | public int firePower() |
---|
29 | { |
---|
30 | return 10; |
---|
31 | } |
---|
32 | |
---|
33 | public string name() |
---|
34 | { |
---|
35 | return "Pistol"; |
---|
36 | } |
---|
37 | } |
---|
38 | |
---|
39 | public class Rifle : Weapon |
---|
40 | { |
---|
41 | public Rifle(double width, double height) |
---|
42 | : base(width, height) |
---|
43 | { |
---|
44 | Image = Game.LoadImage("Images/gaussrifle"); |
---|
45 | AttackSound = Game.LoadSoundEffect("Sounds/assaultrifleshot"); |
---|
46 | AmmoIgnoresGravity = true; |
---|
47 | InfiniteAmmo = true; |
---|
48 | Power.DefaultValue = 1000; |
---|
49 | } |
---|
50 | |
---|
51 | protected override PhysicsObject CreateProjectile() |
---|
52 | { |
---|
53 | Projectile proj = new Projectile(1, 1.5, Color.DarkGray); |
---|
54 | proj.CollisionIgnoreGroup = 1; |
---|
55 | return proj; |
---|
56 | } |
---|
57 | |
---|
58 | public int firePower() |
---|
59 | { |
---|
60 | return 15; |
---|
61 | } |
---|
62 | |
---|
63 | public string name() |
---|
64 | { |
---|
65 | return "Rifle"; |
---|
66 | } |
---|
67 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.