Commit d077341ec9c9b37d298d6ecfdaa40f8ea4e19de4

Authored by Marius Hanne
1 parent 089580e2db
Exists in master

colored bullets

Showing 5 changed files with 20 additions and 7 deletions Side-by-side Diff

data/images/bullet_green.png

1.55 KB

data/images/bullet_red.png

1.62 KB

... ... @@ -3,7 +3,7 @@
3 3 attr_accessor :score
4 4  
5 5 def initialize game, options
6   - options[:type] = :fighter
  6 + options[:type] = :player
7 7 options[:a] = 180.0
8 8 options[:layers] = 0x11 # 1, 2
9 9 super game, options
... ... @@ -2,14 +2,27 @@
2 2  
3 3 SHIPS = {
4 4 glider: { power: 50, shield: 20, speed: 2.5, weapons: [:laser],
5   - image: { image: "ship.png", zoom: 0.5 }},
  5 + image: { image: "ship.png", zoom: 0.5 },
  6 + explosion: { zoom: 1.0, volume: 1.0 },
  7 + },
6 8 drone: { power: 75, shield: 50, speed: 2, weapons: [:missile],
7   - image: { image: "ship.png", zoom: 0.7 }},
  9 + image: { image: "ship.png", zoom: 0.7 },
  10 + explosion: { zoom: 1.0, volume: 1.0 },
  11 + },
8 12 fighter: { power: 100, shield: 100, speed: 1, weapons: [
9 13 :laser, :torpedo, :missile ],
10   - image: { image: "ship.png", zoom: 1.0 }},
  14 + image: { image: "ship.png", zoom: 1.0 },
  15 + explosion: { zoom: 1.0, volume: 1.0 },
  16 + },
  17 + player: { power: 100, shield: 100, speed: 1, weapons: [
  18 + :laser, :torpedo, :missile, :laser ],
  19 + image: { image: "ship.png", zoom: 1.0 },
  20 + explosion: { zoom: 1.0, volume: 1.0 },
  21 + },
11 22 spinner: { power: 50, shield: 50, speed: 2, rot: 0.1, weapons: [:laser],
12   - image: { image: "ship2.png", zoom: 0.3 }},
  23 + image: { image: "ship2.png", zoom: 0.3 },
  24 + explosion: { zoom: 1.0, volume: 1.0 },
  25 + },
13 26 }
14 27  
15 28 attr_accessor :power, :image, :type, :debug
... ... @@ -4,9 +4,9 @@
4 4 laser: { damage: 10, speed: 15, freq: 900,
5 5 image: { image: "bullet.png", zoom: 1.0 }},
6 6 missile: { damage: 20, speed: 5, freq: 300,
7   - image: { image: "bullet.png", zoom: 2.0 }},
  7 + image: { image: "bullet_green.png", zoom: 2.0 }},
8 8 torpedo: { damage: 30, speed: 1, freq: 100,
9   - image: { image: "bullet.png", zoom: 3.0 }},
  9 + image: { image: "bullet_red.png", zoom: 3.0 }},
10 10 }
11 11  
12 12 attr_reader :ship, :game, :type, :params