-
Notifications
You must be signed in to change notification settings - Fork 0
/
pod_seeder.rb
66 lines (53 loc) · 1.16 KB
/
pod_seeder.rb
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
61
62
63
64
65
66
class PodSeeder
def self.desc(key, description = nil)
@desc ||= {}
@desc[key] = description if description
@desc[key]
end
def self.seeders
@desc
end
desc :dev_seed, "Dev Seed: The original development seed set for this game (2011)"
def self.dev_seed(game)
game.new_pods_at([
[5,5],
[5,6],
[5,4],
[10,10],
[10,11],
[10,12],
[9,12],
[8,11],
[20,10],
[20,11],
[20,12],
[19,12],
[18,11]
])
(0..100).each do |y|
game.new_pod_at(0,y)
end
(50..75).each do |y|
(50..75).each do |x|
game.new_pod_at(x,y)
end
end
end
desc :random, "Drop a bunch of random seeds"
def self.random(game)
settings = game.settings
width = settings[:window_columns]
height = settings[:window_rows]
center_x = width / 2
center_y = height / 2
min_x = center_x - (width * 1)
max_x = center_x + (width * 1)
min_y = center_y - (height * 1)
max_y = center_y + (height * 1)
5000.times do
x = rand(min_x..max_x)
y = rand(min_y..max_y)
game.new_pod_at(x,y) unless game.pod_at(x,y)
end
end
end