1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
FF::Sys.new('StartGame', priority: 50 ) do
thing = FF::Cmp::Title[0].entities.clone
thing.each do |entity|
entity.components[FF::Cmp::Sprite][0].delete
if (!entity.components[FF::Cmp::Button].nil? && !entity.components[FF::Cmp::Hitbox].nil?)
entity.components[FF::Cmp::Hitbox][0].delete
entity.components[FF::Cmp::Button][0].delete
end
entity.delete
end
FF::Cmp::Title[0].delete
FF::Stg.remove FF::Scn::TitleScreen
debug_arrow = FF::Cmp::SingletonDebugVectorArrow.new(length: 5)
position = [
{x: 100, y: 100},
{x: 500, y: 500},
{x: 700, y: 200},
{x: 150, y: 250},
]
position_range = (100..700).to_a
sprite = FF::Cmp::Sprite.new
sprite.props[:path] = 'sprites/background.png'
FF::Ent.new(
sprite,
FF::Cmp::SingletonCamera[0],
FF::Cmp::Boid.new(h: 1920 * 2, w: 1920 * 2)
)
5.times do |pos|
Factory::Osprey.new(x: position_range.sample, y: position_range.sample)
end
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, w: sprite.props[:w], h: sprite.props[:h]),
sprite,
debug_arrow,
FF::Cmp::SingletonCamera[0],
FF::Cmp::BoidBounds.new,
FF::Cmp::Follow.new(target: :mouse, strength: 500),
FF::Cmp::SingletonPlayer[0],
FF::Cmp::Team.new(team: 'player'),
FF::Cmp::Weapon.new,
)
FF::Stg.add(
FF::Scn::BoidRules,
FF::Scn::Camera,
FF::Scn::Debug,
)
FF::Scn::Debug.add(FF::Sys::DebugRenderVectorArrow)
@pause = false
#FF::Stg.remove FF::Scn::BoidRules
end
|