Assorted bug fixes. Demo scenario complete.

This commit is contained in:
2014-03-09 16:00:13 -04:30
parent 05d6914861
commit 83cdd38c41
10 changed files with 474 additions and 115 deletions

View File

@@ -30,7 +30,7 @@ CELL_SIZE = 10
MAP_SIZE = (64, 64) MAP_SIZE = (64, 64)
SCREEN_SIZE = ((MAP_SIZE[1] * CELL_SIZE) + 1, (MAP_SIZE[0] * CELL_SIZE) + 1) SCREEN_SIZE = ((MAP_SIZE[1] * CELL_SIZE) + 1, (MAP_SIZE[0] * CELL_SIZE) + 1)
SCREEN_FLAGS = pygame.HWSURFACE | pygame.DOUBLEBUF SCREEN_FLAGS = pygame.HWSURFACE | pygame.DOUBLEBUF
TITLE = "Cyberpunk Jam 2014 - Level editor" TITLE = "CyJam :: "
FPS = 60 FPS = 60
# Cell types # Cell types
@@ -278,6 +278,7 @@ def main():
obj_str = "" obj_str = ""
fl_str = "" fl_str = ""
mouse_pos = (0, 0) mouse_pos = (0, 0)
mouse_cell = (0, 0)
mouse_r_click = False mouse_r_click = False
mouse_l_click = False mouse_l_click = False
@@ -298,7 +299,7 @@ def main():
# Set title bar. # Set title bar.
obj_str = get_object_type_name(curr_obj) obj_str = get_object_type_name(curr_obj)
fl_str = get_floor_type_name(curr_fl) fl_str = get_floor_type_name(curr_fl)
title = TITLE + " :: FPS: " + str(int(fps)) title = TITLE + str(mouse_cell) + " :: FPS: " + str(int(fps))
title += " :: " + obj_str + " :: " + fl_str title += " :: " + obj_str + " :: " + fl_str
pygame.display.set_caption(title) pygame.display.set_caption(title)
@@ -315,6 +316,9 @@ def main():
mouse_l_click = True mouse_l_click = True
if event.type == pygame.MOUSEMOTION: if event.type == pygame.MOUSEMOTION:
i = mouse_pos[1] // CELL_SIZE
j = mouse_pos[0] // CELL_SIZE
mouse_cell = (i, j)
if mouse_r_click: if mouse_r_click:
mouse_pos = event.pos mouse_pos = event.pos

80
maps/aquarium.map Normal file
View File

@@ -0,0 +1,80 @@
[MAP]
32 32
00000000000000166100000000000000
01155111551101166110111111111110
01666666666111777711166666666610
05666666666261777716266666666650
05664444466111777711166444446650
01664818466101777710166481846610
01664888466111122111166488846610
05664181466266666666266418146650
05664181466111155111166418146650
01664181466105777750166418146610
01664888466105777750166488846610
05664818466111177111166481846650
05664444466266277266266444446650
01666666666111177111166666666610
01166666666111999911166666666110
00116666666116666661166666661100
00011666666666666666666666611000
00001166666666666666666666110000
00000155155116666661155155100000
00000000000016666661000000000000
00000000000011666611000000000000
00000000000001666610000000000000
00000000000001166110000000000000
00000000000000166100000000000000
11555111555111166111155511155511
13333614464417766771446441699991
18883614666417666671466641667791
18883666666666666666666666697791
18883666666666666666666666697791
18883614666417666671466641697791
13333614464417766771446441699991
11555111555111166111155511155511
[PLAYER]
%player = X Y
player = 30 16
[EXITS]
%exit = X Y MAP_NAME MAP_X MAP_Y
exit = 0 15 END 0 0
exit = 0 16 END 0 0
[DOORS]
%door = X Y ID UNLOCKED
door = 1 15 1 0
door = 1 16 1 0
door = 24 15 0 1
door = 24 16 0 1
door = 27 6 0 1
door = 27 12 0 1
door = 27 19 0 1
door = 27 25 0 1
door = 28 6 0 1
door = 28 12 0 1
door = 28 19 0 1
door = 28 25 0 1
door = 31 15 2 0
door = 31 16 2 0
[KEYS]
%key = X Y ID
key = 3 12 1
[PERSONS]
%person = X Y NAME DIALOG_ID
person = 3 19 Cyd 0
person = 9 6 Godot 1
person = 9 15 Juan 2
person = 9 16 Salvo 3
person = 15 5 Jade 4
person = 15 26 Wilco 5
person = 26 5 Mildagrad 6
person = 28 28 Bartender 7
[DIALOGS]
%dialog = ID TEXT
dialog = 0 Hello!
dialog = 1 How did you get in here?!
dialog = 2 Bonjour! I cannot give you the key. I misplaced it.
dialog = 3 Bonjour.
dialog = 4 I think there is someone in that aquarium over there.
dialog = 5 I heard some noises coming from inside the wall!
dialog = 6 This aquarium would be better with some fish in it!
dialog = 7 Welcome to the bar. Would you like something to drink?

96
maps/maze.map Normal file
View File

@@ -0,0 +1,96 @@
[MAP]
64 64
1111111111111111111111111111111111111111111111111111111111111110
1727172727272717272727172717172717272717271727172727271727272710
1212121212121211121212121212121212111112111212121211111211111210
1717172727172727271717172727271727271727172717171717271727172710
1212111112121112111112121212121111121211111212111212121112111210
1727271717172717271717272717172717272727272717272717172717271710
1211121212111112111222111111111211121112111111111112111211111210
1727172727172727172717272727172717271717272717172727172717272710
1212121211121211121111111212121111121211121112121111111212111210
1717172717271717271727171717272727272727171727271727171727171710
1212111111121111121211121212121111121211121112121212121112121110
1727272727271727271717272717171727171717271727171717272717272710
1211111112111211111211121212121211121112111112111112111211121110
1727271727172727272727171717171727271717272727271727172717271710
1112111212111212111111121212121111111211111111111112111212111210
1717172717271727171727271717172727171717171717171727172727272710
1212121111121112121212121212121112121212121212121211111111121110
1727171727272727271717272717171717271727272727272717272717271710
1211121211121211121211111111121211121211121211121112111212111210
1727271727171717172717171727272717272717271727172727172727271710
1111111112111212121112121212121111111112121112121111111211111210
1717272727172717171727272717171717171727171727171727272717172710
1212121111121112121111121112111212121211121111121212111112121110
1727171727171727271727271717172717272717272727271717272727171710
1111121211121112111211111212121212121112111111121211121112121210
1727271727172717272717272727171727171727172727271727171727272710
1212121211111212111211121111111211121112111112111211121111111210
1717172717272717271717271727171717271727271727272727172727271710
1212121211111211121211121112121611111111121112121111111211121210
1717171717271727271727171727276667172727171727171727272727171710
1212111212121111111112121112111611121211121111121112111111121110
1717271727172727172717271727172717171727172777171727172727272710
1111111111121211121211111112111212121211111112121212121111111210
1727172727171717271727272727271727271727272727271717171727272710
1112111212121211121212111112111211111111111112111212121111121210
1727271717271727271717171717172717172717272727272717172717271710
1111121212121211111112121211121212121212111111111112111211121110
1727172717172727171717271727272717271717172727172727272727271710
1112112112111112121211121211111111121212121112111111121212111210
1727172727172717272717271727171727271727171717272727171717272710
1112121111121211111112111112121211121211121211121112111211111210
1727271727271717172727171727272717272717171727172717271727172710
1211111111111212121111121211121211111112121211111211121212121210
1727272727272717271727171727171727271717272727271717171717171710
1111111112111212111212121112111111121212111211121212121212121110
1727272717171717172717271717272727172717171717171717271717272710
1211111212121112121211111212111211111212121212121112111111121210
1727271727172727271727271727171717271727171717172727271727271710
1112111111121111111212111211121212121111121212111211121211111210
1727172727271717271717171717271717172717172727172717271717172710
1111121112111212121211121211121111121211111111111212111212121210
1727171727172727171727272717272727171717272717171717271727271710
1212111212111211121112111111111112121112111212121211121112121110
1717271717271727171717172727272727172727171717272717172727272710
1211121212121111121212111211111211111111121211121212121111111210
1717171717172717271717272717271717272727271727272717271717272710
1112121112111212111211121112121211111211121112121111111211121210
1727272717271717272717171717171727271717272727171727272717271710
1112111211111212111212111212121111121112121211111211111212111210
1727171717272717272727272727171727172727171717172717171717172710
1112121212111112111212111212121212121111121212121212121112121210
1727172727272727172717172717172717271727271727271717272727271710
1111111111111111111111111111111111111111111111111111111111111110
0000000000000000000000000000000000000000000000000000000000000000
[PLAYER]
%player = X Y
player = 1 1
[EXITS]
%exit = X Y MAP_NAME MAP_X MAP_Y
exit = 29 31 END 0 0
[DOORS]
%door = X Y ID UNLOCKED
door = 28 31 1 0
door = 29 30 2 0
door = 29 32 3 0
door = 30 31 4 0
[KEYS]
%key = X Y ID
key = 17 37 4
key = 31 43 3
key = 53 23 2
key = 57 57 1
[PERSONS]
%person = X Y NAME DIALOG_ID
person = 1 3 Steven 0
person = 1 61 Amethyst 1
person = 61 1 Pearl 2
person = 61 61 Garnet 3
[DIALOGS]
%dialog = ID TEXT
dialog = 0 You need any of the four keys to exit this maze.
dialog = 1 GET ME OUT OF HERE!
dialog = 2 Now where is Steven? I told him this place was dangerous!
dialog = 3 Each key works on one door only.

View File

@@ -1,61 +1,173 @@
[MAP] [MAP]
32 32 64 64
00000000000000000000000000000000 0000000000000000000000000000017710000000000000000000000000000000
00000000000044444440000000000000 0111111111111100000000000000117711000011111111111111111111111110
00000000000441111144000000000000 0161626162616110000000000001137731100014441666666666666666666610
00000000004411666114400000000000 0161616161626611000000000011837738110014771699999999999999999610
44444000044116777611440000000000 0121112111112111100000000018837738810014776666666666666666669610
41514400441167777761144000000000 0162616262626161110000000013337733310014991696999999999999999910
41771440411677737776114444444000 0111212121211121610000000013337733310014991696666666666666666910
41777144416777383777614115114000 0162616161616261610000000018837738810014776699999999999999996910
41997711116773888377611166614000 0111211121212111611111111111837738110014771696666666666666696910
41797726626738888837666666654000 0162616261626261626666666661137731100014441111111111111111116110
41997711116773888377611166614000 0121112121211121611111111161626611000011111000166666666666666610
41777144416777383777614115114000 0162626161626162610000000161616610000000000000166666666666666610
41771440411677737776114444444000 0111111111111111111115511121116611111111111111166633333333336610
41514400441167777761144000000000 0000040000004000001777777166666666661666666666666638888888836610
44444000044116777611440000000000 4444444444444444441797777667777777766666666133166638888888836610
00000000004411666114400000000000 0000040000004000005797777167777777761666666388366638888888836610
00000000000441161144000000000000 0011111115111111105797777167777777761666666388366638888888836610
00000000000044565440000000000000 0018166177716618101797777667777777766666666133166633333333336610
00000000000004161400000000000000 0016166177716616101777777167777777761666666666666666666666666610
00000000000004565400000000000000 0016161199911616101115511166666666661111111111166666666666666610
00000000444444161444444000000000 0016666166616666100000000111116611111000000000111111111111111110
00000000411551161155114000000000 0056666166616666500000440000016610000044000000000000000000000000
00000000416666666666614000000000 0056666666666666500000440000016610000044000000000000000000000001
00000000456666666666654000000000 0016666166616666100000440000016610000044000000000000000000000011
00000000456677777776654000000000 0011111166611111100000440000016610000044000000000000000000000111
00000000416677777776614000000000 0018177166616618104444444444036630444444444400000000000000000181
00000000416677777776614000000000 0016177166616616104444444444036630444444444400000000000000000181
00000000456677777776654000000000 0016161166611616100000440000016610000044000000000000000000100181
00000000456666666666654000000000 0017777166616666100000440000016610000044000000000000000001100181
00000000416666666666614000000000 0057777166616776504000440000016610000044000000000000000011100181
00000000411551151155114000000000 0059977666666776504000440000016610000044000000000000000118100161
00000000444444444444444000000000 0017977166616666104000000000116611000000000000000000000188100161
0011111166611111104000000001166661100000000000000000000188100161
0018166166616618104000000011667766110000000000000000100188100161
0016166166616616100000000116677776611000000000000001100188100181
0016161166611616104000001166777777661100000000000011100133100181
0016666166616666104000001667777777766100000000000118100166100181
0056666166616666504000011677777777776110000000000188100166100181
0056666666666666504000116677777777776611000000000188100166100181
0016666166616666104001166777777777777661100000100188100166100181
0011111166111111100011667777777777777766110001100133100166100161
0000000166100000000011677777777777777776110011100166100166100161
0000000166100000000011677777777777777776110118100166100166100161
0000000166101111110011677777777777777776110188100166100166100161
0000000166101388310011667777777777777766110188100166100166100161
0115151166101888810001166777777777777661100133100166100166100181
0166666666101888811111226677777777776611000166100166100166100161
0166666666101388826666611667777777766110000166100166100166100161
0566111111101111111111111696777777696100000166100166100166100181
0566100000000000000000001696777777696100000166100166100166100181
0566111111111111111111111996777777699111111166111166111166111121
0166666666666666666666666666777777666666666666666666666666662661
0166666666666666666666666666666666666666666666666666666666662661
0115511551111551155116611311661166113116611551155111155115511111
0000000000000000000017777777741147777777710000000000000000000000
0044444444444444444057777777741147777777750444444444444444440000
0040004000400040004017799999741147999997710400040004000400040000
0044444444444444444057777777741147777777750444444444444444440000
0040004000400040004017799999741147999997710400040004000400040000
0044444444444444444011777777711117777777110444444444444444440000
0040004000400040004001177777110011777771100400040004000400040000
0044444444444444444000111111100001111111000444444444444444440000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
[PLAYER] [PLAYER]
%player = X Y %player = X Y
player = 27 15 player = 26 30
[EXITS] [EXITS]
%exit = X Y MAP_NAME MAP_X MAP_Y %exit = X Y MAP_NAME MAP_X MAP_Y
exit = 8 25 maps/start.map 0 0 exit = 2 30 maps/aquarium.map 0 0
exit = 9 25 maps/start.map 0 0 exit = 2 31 maps/aquarium.map 0 0
exit = 10 24 END 0 0 exit = 11 28 maps/maze.map 0 0
exit = 10 25 maps/start.map 0 0
[DOORS] [DOORS]
%door = X Y ID UNLOCKED %door = X Y ID UNLOCKED
door = 9 22 0 0 door = 4 42 0 1
door = 7 42 0 1
door = 9 60 0 1
door = 10 28 1 0
door = 10 30 2 0
door = 10 31 2 0
door = 13 43 0 1
door = 13 46 0 1
door = 14 25 0 1
door = 17 25 0 1
door = 18 43 0 1
door = 18 46 0 1
door = 19 3 0 1
door = 19 5 0 1
door = 19 13 0 1
door = 19 15 0 1
door = 22 7 0 1
door = 22 11 0 1
door = 27 3 5 0
door = 27 5 0 1
door = 27 13 0 1
door = 27 15 0 1
door = 30 7 4 0
door = 30 11 0 1
door = 31 30 3 0
door = 31 31 3 0
door = 35 3 0 1
door = 35 5 0 1
door = 35 13 0 1
door = 35 15 0 1
door = 38 7 0 1
door = 38 11 0 1
[KEYS] [KEYS]
%key = X Y ID %key = X Y ID
key = 7 2 0 key = 2 8 5
key = 7 40 3
key = 25 3 1
key = 51 62 2
key = 40 62 4
[PERSONS] [PERSONS]
%person = X Y NAME DIALOG_ID %person = X Y NAME DIALOG_ID
person = 8 24 Hugo 0 person = 3 4 Stan 0
person = 9 2 Paco 1 person = 3 8 Dora 1
person = 23 11 Luis 2 person = 3 40 Bill 2
person = 23 19 Donald 3 person = 4 61 Jenny 3
person = 5 14 Cilia 4
person = 7 2 Herdier 5
person = 8 31 Doorman 6
person = 8 40 Soos 7
person = 15 19 Barman 8
person = 15 24 Haddock 9
person = 16 39 Dipper 10
person = 16 40 Mabel 11
person = 17 12 Itan 12
person = 17 22 Astro 13
person = 19 61 Ittle 14
person = 22 4 Malon 15
person = 25 62 Error 16
person = 30 15 Walter 17
person = 34 6 Rosa 18
person = 34 15 Calvin 19
person = 39 3 Nate 20
person = 40 27 Deckard 21
person = 40 35 Lester 22
person = 45 14 Misty 23
person = 45 31 Hobbes 24
person = 49 25 Juniper 25
person = 49 36 Tipsie 26
[DIALOGS] [DIALOGS]
%dialog = ID TEXT %dialog = ID TEXT
dialog = 0 Step into the elevator to retry. dialog = 0 Finally, I have them all!
dialog = 1 I'm unreachable! dialog = 1 I wonder what this key is for.
dialog = 2 Welcome to Cyjam! dialog = 2 I'll be watching you...
dialog = 3 Have fun. dialog = 3 Hi, how you doin'?
dialog = 4 Who designs buildings like this? I'm lost!
dialog = 5 Woof!
dialog = 6 Enjoyed your stay?
dialog = 7 Now you can go to the apartment building.
dialog = 8 Want a tip? Go to the very end of the largest hallway.
dialog = 9 They serve the best drinks in here!
dialog = 10 Have you seen our uncle?
dialog = 11 Stan! Where are you?
dialog = 12 ZZZZzzzzzz...
dialog = 13 That man sure drinks a lot!
dialog = 14 Keep an eye out for secret places!
dialog = 15 What are you doing in my house?!
dialog = 16 You never saw me here, OK?
dialog = 17 Like the rug? It really ties the room together!
dialog = 18 ZZZZzzzzzz...
dialog = 19 Hey! Knock first!
dialog = 20 Have you seen dog? It's name is Herdier and it ran away!
dialog = 21 This is one fancy building, all right.
dialog = 22 There seems to be an electrical storm coming this way.
dialog = 23 I love swimming? Do you swim?
dialog = 24 Why won't he hurry?! We are already late as it is!
dialog = 25 May I help you?
dialog = 26 May I help you?

61
maps/test.map Normal file
View File

@@ -0,0 +1,61 @@
[MAP]
32 32
00000000000000000000000000000000
00000000000044444440000000000000
00000000000441111144000000000000
00000000004411666114400000000000
44444000044116777611440000000000
41514400441167777761144000000000
41771440411677737776114444444000
41777144416777383777614115114000
41997711116773888377611166614000
41797726626738888837666666654000
41997711116773888377611166614000
41777144416777383777614115114000
41771440411677737776114444444000
41514400441167777761144000000000
44444000044116777611440000000000
00000000004411666114400000000000
00000000000441161144000000000000
00000000000044565440000000000000
00000000000004161400000000000000
00000000000004565400000000000000
00000000444444161444444000000000
00000000411551161155114000000000
00000000416666666666614000000000
00000000456666666666654000000000
00000000456677777776654000000000
00000000416677777776614000000000
00000000416677777776614000000000
00000000456677777776654000000000
00000000456666666666654000000000
00000000416666666666614000000000
00000000411551151155114000000000
00000000444444444444444000000000
[PLAYER]
%player = X Y
player = 27 15
[EXITS]
%exit = X Y MAP_NAME MAP_X MAP_Y
exit = 8 25 maps/start.map 0 0
exit = 9 25 maps/start.map 0 0
exit = 10 24 END 0 0
exit = 10 25 maps/start.map 0 0
[DOORS]
%door = X Y ID UNLOCKED
door = 9 22 0 0
[KEYS]
%key = X Y ID
key = 7 2 0
[PERSONS]
%person = X Y NAME DIALOG_ID
person = 8 24 Hugo 0
person = 9 2 Paco 1
person = 23 11 Luis 2
person = 23 19 Donald 3
[DIALOGS]
%dialog = ID TEXT
dialog = 0 Step into the elevator to retry.
dialog = 1 I'm unreachable!
dialog = 2 Welcome to Cyjam!
dialog = 3 Have fun.

View File

@@ -167,6 +167,7 @@ gsname_t update(){
} }
newMsg = TRUE; newMsg = TRUE;
msgThen = clock(); msgThen = clock();
freeKey++;
} }
} }
} }
@@ -418,28 +419,33 @@ void drawNeon(int i, int j, floor_t floor){
else attron(COLOR_PAIR(SN_COLOR)); else attron(COLOR_PAIR(SN_COLOR));
} }
n = map[i ][j - 1 < 0 ? mH - 1 : j - 1].f == floor; w = map[i ][j - 1 < 0 ? mH - 1 : j - 1].f == floor;
s = map[i ][(j + 1) % mH ].f == floor; e = map[i ][(j + 1) % mH ].f == floor;
e = map[i - 1 < 0 ? mW - 1 : i - 1][j ].f == floor; s = map[i - 1 < 0 ? mW - 1 : i - 1][j ].f == floor;
w = map[(i + 1) % mW ][j ].f == floor; n = map[(i + 1) % mW ][j ].f == floor;
if((n && s && e) && (!w)){ if((n && s && e) && (!w)){
printw("\u2560"); printw("\u2560");
return; return;
} }
if((n || s) && (!e && !w)){ if((n && s && w) && (!e)){
printw("\u2550"); printw("\u2563");
return; return;
} }
if((e || w) && (!n && !s)){ if((n || s) && (!e && !w)){
printw("\u2551"); printw("\u2551");
return; return;
} }
if((e || w) && (!n && !s)){
printw("\u2550");
return;
}
if((e && n) && (!s && !w)){ if((e && n) && (!s && !w)){
printw("\u255D"); printw("\u2554");
return; return;
} }
@@ -454,17 +460,17 @@ void drawNeon(int i, int j, floor_t floor){
} }
if((w && s) && (!n && !e)){ if((w && s) && (!n && !e)){
printw("\u2554"); printw("\u255D");
return; return;
} }
if((s && e && w) && (!n)){ if((s && e && w) && (!n)){
printw("\u2560"); printw("\u2569");
return; return;
} }
if((n && w && e) && (!s)){ if((n && w && e) && (!s)){
printw("\u2563"); printw("\u2566");
return; return;
} }