diff options
| author | realtradam <[email protected]> | 2021-12-18 02:03:57 -0500 |
|---|---|---|
| committer | realtradam <[email protected]> | 2021-12-18 02:03:57 -0500 |
| commit | 509f53c9bca30de88af6f12c371ca637a9a4f9a3 (patch) | |
| tree | fff0eb4fcea193a1c1acb383817bdf61c67458e9 /app/tick.rb | |
| parent | 264b2f9e92a475db75904f72cad2bc8131b39dda (diff) | |
| download | SteelWings-509f53c9bca30de88af6f12c371ca637a9a4f9a3.tar.gz SteelWings-509f53c9bca30de88af6f12c371ca637a9a4f9a3.zip | |
fixed separation defaults, centering sprites
Diffstat (limited to 'app/tick.rb')
| -rw-r--r-- | app/tick.rb | 66 |
1 files changed, 30 insertions, 36 deletions
diff --git a/app/tick.rb b/app/tick.rb index 60ffbd5..7539405 100644 --- a/app/tick.rb +++ b/app/tick.rb @@ -1,40 +1,34 @@ debug_arrow = FF::Cmp::DebugVectorArrow.new(length: 5) -FF::Ent.new( - FF::Cmp::Sprite.new, - FF::Cmp::Boid.new(x: 10, y: 10), - FF::Cmp::BoidBounds.new, - #FF::Cmp::BoidsAlignment.new, - FF::Cmp::BoidsSeparation.new, - #FF::Cmp::BoidsCohesion.new, - debug_arrow, -) -FF::Ent.new( - FF::Cmp::Sprite.new, - FF::Cmp::Boid.new(x: 50, y: 50), - FF::Cmp::BoidBounds.new, - #FF::Cmp::BoidsAlignment.new, - FF::Cmp::BoidsSeparation.new, - #FF::Cmp::BoidsCohesion.new, - debug_arrow, -) -FF::Ent.new( - FF::Cmp::Sprite.new, - FF::Cmp::Boid.new(x: 70, y: 20), - FF::Cmp::BoidBounds.new, - #FF::Cmp::BoidsAlignment.new, - FF::Cmp::BoidsSeparation.new, - #FF::Cmp::BoidsCohesion.new, - debug_arrow, -) -FF::Ent.new( - FF::Cmp::Sprite.new, - FF::Cmp::Boid.new(x: 150, y: 250), - FF::Cmp::BoidBounds.new, - #FF::Cmp::BoidsAlignment.new, - FF::Cmp::BoidsSeparation.new, - #FF::Cmp::BoidsCohesion.new, - debug_arrow, -) +position = [ + {x: 100, y: 100}, + {x: 500, y: 500}, + {x: 700, y: 200}, + {x: 150, y: 250}, +] +position_range = (100..700).to_a + +25.times do |pos| + sprite = FF::Cmp::Sprite.new + sprite.props[:path] = 'sprites/kenny/Ships/ship_0011.png' + FF::Ent.new( + FF::Cmp::Boid.new(x: position_range.sample, y: position_range.sample, vx: 25, vy: 25), + sprite, + FF::Cmp::BoidBounds.new(strength: 1), + FF::Cmp::BoidsAlignment.new(strength: 1), + FF::Cmp::BoidsSeparation.new(distance: 150, strength: 0.01), + FF::Cmp::BoidsCohesion.new(strength: 100), + #debug_arrow, + ) +end +#FF::Ent.new( +# FF::Cmp::Sprite.new, +# FF::Cmp::Boid.new(x: 150, y: 250), +# FF::Cmp::BoidBounds.new, +#FF::Cmp::BoidsAlignment.new, +# FF::Cmp::BoidsSeparation.new(strength: 1.0), +# #FF::Cmp::BoidsCohesion.new, +# debug_arrow, +#) FF::Scn::Debug.add(FF::Sys::DebugRenderVectorArrow) @pause = true FF::Stg.remove FF::Scn::BoidRules |
