missile-command-ruby 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.5
1
+ 0.0.6
data/lib/explosion.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  class Explosion < Actor
2
- attr_reader :collision_radius
2
+ use InterpolationSystem
3
+ collides_as :explosion
3
4
 
4
5
  def initialize(opts={})
5
6
  super
@@ -11,14 +12,15 @@ class Explosion < Actor
11
12
 
12
13
  interpolate_alpha(:init => 255, :end => 0, :duration => @explosion_time - @fade_after, :start_in => @fade_after)
13
14
  interpolate_saturation(:init => 0.0, :end => 1.0, :duration => 0.1, :loop => true)
14
- # Don't know why gosu changes my hue when transforming saturation
15
- # alone so we keep it fixed, or give it a little space for change
15
+ # Don't know why gosu changes my hue when only transforming
16
+ # saturation so we keep it fixed, or give it a little space for
17
+ # change
16
18
  interpolate_hue(:init => @color.hue-50, :end => @color.hue+50, :loop => true, :duration => 0.5)
17
19
 
18
20
  self.radius = @initial_radius
19
21
  # Expand or shrink the explosion
20
22
  interpolate(self, :radius, :init => @initial_radius, :end => @end_radius, :duration => @explosion_time)
21
- collides_as :explosion
23
+
22
24
  @z = 7
23
25
  @elapsed_time = 0.0
24
26
  end
@@ -32,6 +34,10 @@ class Explosion < Actor
32
34
  @elapsed_time += dt
33
35
  end
34
36
 
37
+ def collision_radius
38
+ @collision_radius
39
+ end
40
+
35
41
  def radius=(radius)
36
42
  @collision_radius = radius
37
43
  @factor_x = 2*radius/@image.width
@@ -12,13 +12,14 @@ require 'missile'
12
12
  require 'cross_hair'
13
13
 
14
14
  class MissileCommand < Game
15
+ use CollisionSystem
16
+ #use StalkerSystem, :stalk => [Actor, Silo, Missile, Explosion, TextBox]
15
17
 
16
18
  def initialize
17
19
  super
18
- setup_events
19
20
  @info = TextBox.new(:size => 15)
20
21
  @info.text("Press F1 to hide this text | F2 debug info | F3 toggle pause", :size => 24)
21
- @info.watch(@systems[FpsSystem], :size => 20)
22
+ @info.watch(lambda{ fps }, :size => 20)
22
23
  @info.watch(@systems[StalkerSystem], :color => 0xff33ccff)
23
24
  @info.text("Click on screen to launch some missiles!")
24
25
  end
@@ -38,14 +39,6 @@ class MissileCommand < Game
38
39
  Gosu::KbF3 => [:pause!, false])
39
40
  end
40
41
 
41
- def setup_systems
42
- # It's important to call super here to setup the InputSystem
43
- super
44
- use(CollisionSystem)
45
- use(FpsSystem)
46
- use(StalkerSystem, :stalk => [Actor, Silo, Missile, Explosion, TextBox, Object])
47
- end
48
-
49
42
  def setup_actors
50
43
  @player = Silo.new(:x => width/2,
51
44
  :width => 100,
data/lib/missile.rb CHANGED
@@ -1,12 +1,13 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  class Missile < Actor
3
- attr_reader :collision_radius
3
+ use SteeringSystem
4
+ use AnimationSystem
5
+
6
+ collides_as :missile
4
7
 
5
8
  def initialize(opts={})
6
9
  super
7
- use(SteeringSystem, opts)
8
10
  activate(:seek)
9
- collides_as :missile
10
11
  @last_distance_to_target = nil
11
12
  @target = nil
12
13
  set_image('missile-med.png', opts)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{missile-command-ruby}
8
- s.version = "0.0.5"
8
+ s.version = "0.0.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["lobo_tuerto"]
12
- s.date = %q{2011-02-22}
12
+ s.date = %q{2011-02-24}
13
13
  s.default_executable = %q{missile-command-ruby}
14
14
  s.description = %q{Protect your cities, destroy the incoming enemy missiles!}
15
15
  s.email = %q{dev@lobotuerto.com}
@@ -55,7 +55,7 @@ Gem::Specification.new do |s|
55
55
  ]
56
56
  s.homepage = %q{http://github.com/lobo-tuerto/missile-command-ruby}
57
57
  s.require_paths = ["lib"]
58
- s.rubygems_version = %q{1.5.0}
58
+ s.rubygems_version = %q{1.5.2}
59
59
  s.summary = %q{Missile command in Ruby!}
60
60
 
61
61
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,20 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: missile-command-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
5
- prerelease: !!null
4
+ version: 0.0.6
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - lobo_tuerto
9
- autorequire: !!null
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-02-22 00:00:00.000000000 -06:00
12
+ date: 2011-02-24 00:00:00.000000000 -06:00
13
13
  default_executable: missile-command-ruby
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: lotu
17
- requirement: &24379560 !ruby/object:Gem::Requirement
17
+ requirement: &19031820 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,7 +22,7 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *24379560
25
+ version_requirements: *19031820
26
26
  description: Protect your cities, destroy the incoming enemy missiles!
27
27
  email: dev@lobotuerto.com
28
28
  executables:
@@ -68,7 +68,7 @@ files:
68
68
  has_rdoc: true
69
69
  homepage: http://github.com/lobo-tuerto/missile-command-ruby
70
70
  licenses: []
71
- post_install_message: !!null
71
+ post_install_message:
72
72
  rdoc_options: []
73
73
  require_paths:
74
74
  - lib
@@ -85,9 +85,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  - !ruby/object:Gem::Version
86
86
  version: '0'
87
87
  requirements: []
88
- rubyforge_project: !!null
89
- rubygems_version: 1.5.0
90
- signing_key: !!null
88
+ rubyforge_project:
89
+ rubygems_version: 1.5.2
90
+ signing_key:
91
91
  specification_version: 3
92
92
  summary: Missile command in Ruby!
93
93
  test_files: []