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 = 1250; |
---|
18 | TimeBetweenUse = TimeSpan.FromSeconds(0.45); |
---|
19 | } |
---|
20 | |
---|
21 | protected override PhysicsObject CreateProjectile() |
---|
22 | { |
---|
23 | Projectile proj = new Projectile(1, 1, Color.White); |
---|
24 | proj.CollisionIgnoreGroup = 1; |
---|
25 | return proj; |
---|
26 | } |
---|
27 | |
---|
28 | public int firePower() |
---|
29 | { |
---|
30 | return 5; |
---|
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 = 2000; |
---|
49 | TimeBetweenUse = TimeSpan.FromSeconds(0.12); |
---|
50 | } |
---|
51 | |
---|
52 | protected override PhysicsObject CreateProjectile() |
---|
53 | { |
---|
54 | Projectile proj = new Projectile(1, 1.5, Color.White); |
---|
55 | proj.CollisionIgnoreGroup = 1; |
---|
56 | return proj; |
---|
57 | } |
---|
58 | |
---|
59 | public int firePower() |
---|
60 | { |
---|
61 | return 5; |
---|
62 | } |
---|
63 | |
---|
64 | public string name() |
---|
65 | { |
---|
66 | return "Rifle"; |
---|
67 | } |
---|
68 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.