-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlevelX.cpp.erb
51 lines (45 loc) · 1.16 KB
/
levelX.cpp.erb
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
#include "headers.h"
const byte level1_wall_data [] = {
<% map.each do |row| %>
<% row.each_slice(8) do |byte| %>
<% byte += [0] * (8 - byte.length) %>
B<% byte.each do |cell| %><%= cell || 0 %><% end %>,
<% end %>
<% end %>
};
const Monster level1_monsters [] = {
<% spiders.each do |monster| %>
Monster(MapPos(<%= monster[0] %>,<%= monster[1] %>)),
<% end %>
};
const Door level1_doors [] = {
<% doors.each do |door| %>
Door(MapPos(<%= door[0] %>, <%= door[1] %>), <%= door[2] ? 'HORIZONTAL' : 'VERTICAL' %>),
<% end %>
};
const Key level1_keys [] = {
<% keys.each do |key| %>
Key(MapPos(<%= key[0] %>, <%= key[1] %>)),
<% end %>
};
const Gate level1_gates [] = {
<% gates.each do |gate| %>
Gate(MapPos(<%= gate[0] %>, <%= gate[1] %>)),
<% end %>
};
Level level = Level(
27, // width
15, // height
4, // row_width ( in bytes )
level1_wall_data,
<%= spiders.length %>, // num monsters
level1_monsters,
<%= doors.length %>, // num doors
level1_doors,
<%= keys.length %>,
level1_keys,
<%= gates.length %>,
level1_gates,
Exit(MapPos(<%= exit[0] %>,<%= exit[1] %>)),
Entrance(MapPos(<%= hero[0] %>,<%= hero[1] %>))
);