64
64
idle(SoundPid, SqrPids, Bmps, Colors) ->
66
{gs, newButton, click, Data, Args} ->
66
{gs, newButton, click, _Data, _Args} ->
67
67
init(SoundPid, SqrPids, Bmps, Colors);
68
{gs, aboutButton, click, Data, Args} ->
68
{gs, aboutButton, click, _Data, _Args} ->
70
70
idle(SoundPid, SqrPids, Bmps, Colors);
71
{gs, quitButton, click, Data, Args} ->
71
{gs, quitButton, click, _Data, _Args} ->
73
73
send_to_all(SqrPids, quit);
75
%%io:format("Got ~w in idle~n", [Other]),
75
%%io:format("Got ~w in idle~n", [_Other]),
76
76
idle(SoundPid, SqrPids, Bmps, Colors)
94
94
game(SoundPid, SqrPids, Bmps, Colors, Scores) ->
96
{gs, Square, buttonpress, SqrPid, [1 | Rest]} when pid(SqrPid) ->
96
{gs, _Square, buttonpress, SqrPid, [1 | _Rest]} when pid(SqrPid) ->
98
98
game(SoundPid, SqrPids, Bmps, Colors, Scores);
99
{gs, _Id, buttonpress, _Data, [Butt | Rest]} when Butt =/= 1 ->
99
{gs, _Id, buttonpress, _Data, [Butt | _Rest]} when Butt =/= 1 ->
100
100
NewScores = bomb(SoundPid, SqrPids, Scores),
101
101
game(SoundPid, SqrPids, Bmps, Colors, NewScores);
102
102
{show, Square, Rect} ->
118
118
{bombed, Square, Rect} ->
119
119
NewScores = bombed(SoundPid, SqrPids, Square, Rect, Scores, Colors),
120
120
game(SoundPid, SqrPids, Bmps, Colors, NewScores);
121
{gs, endButton, click, Data, Args} ->
121
{gs, endButton, click, _Data, _Args} ->
122
122
game_over(SoundPid, SqrPids, Bmps, Colors, Scores);
123
{gs, quitButton, click, Data, Args} ->
123
{gs, quitButton, click, _Data, _Args} ->
124
124
quit(SoundPid, SqrPids, Bmps, Colors, Scores);
126
126
game(SoundPid, SqrPids, Bmps, Colors, Scores)
140
140
idle(SoundPid, SqrPids, Bmps, Colors).
143
quit(SoundPid, SqrPids, Bmps, Colors, Scores) ->
143
quit(SoundPid, SqrPids, _Bmps, _Colors, _Scores) ->
145
145
send_to_all(SqrPids, quit),
171
171
Scores#scores{showed=Showed+1}
174
hide_face(Square, Rect, Colors, Scores) ->
174
hide_face(_Square, Rect, _Colors, Scores) ->
175
175
Showed = Scores#scores.showed,
176
176
gs:config(Rect, [{bitmap,lists:append(bonk_dir(),"bitmaps/bonktom")}]),
177
177
Scores#scores{showed=Showed-1}.
180
miss_face(SoundPid, Square, Rect, Colors, Scores) ->
180
miss_face(SoundPid, _Square, Rect, Colors, Scores) ->
181
181
SoundPid ! missed,
182
182
gs:config(Rect, [{bitmap,lists:append(bonk_dir(),"bitmaps/bonkmiss")}, {fg, Colors#colors.miss}]),
183
183
Bonus = Scores#scores.bonus,
190
190
{game_over, Scores}
193
bonked(SoundPid, SqrPids, Square, Rect, Scores, Colors) ->
193
bonked(SoundPid, SqrPids, _Square, Rect, Scores, Colors) ->
194
194
gs:config(Rect, [{bitmap,lists:append(bonk_dir(),"bitmaps/bonkx")}, {fg, Colors#colors.x}]),
196
196
update_score(SoundPid, SqrPids, Scores).
198
bombed(SoundPid, SqrPids, Square, Rect, Scores, Colors) ->
198
bombed(SoundPid, SqrPids, _Square, Rect, Scores, Colors) ->
199
199
gs:config(Rect, [{bitmap,lists:append(bonk_dir(),"bitmaps/bonkbomb")}, {fg, Colors#colors.bomb}]),
200
200
update_score(SoundPid, SqrPids, Scores).
222
send_to_all([],Msg) ->
222
send_to_all([], _Msg) ->
225
225
send_to_all([Pid|Rest],Msg) when pid(Pid) ->
227
227
send_to_all(Rest,Msg);
229
send_to_all([Else|Rest],Msg) ->
229
send_to_all([_Else|Rest],Msg) ->
230
230
send_to_all(Rest,Msg).
268
268
DSX = TextWidth+94, % pixels between status items
269
269
SY = SLineY+2, % y-pos status items
270
270
HiWidth = 100, % width of high score field
271
HiHeight = 180, % height of the same
271
_HiHeight = 180, % height of the same
272
272
HiX = Width-HiWidth, % high score text position
274
274
DHY = 20, % space between title & scores
389
389
create_squares(X, Y, Size, Color, Spc, 1, 1, [], []).
392
create_squares(X, Y, Size, Color, Spc, 4, 5, Pids, Bmps) ->
392
create_squares(_X, _Y, _Size, _Color, _Spc, 4, 5, Pids, Bmps) ->
395
395
create_squares(X, Y, Size, Color, Spc, Row, 5, Pids, Bmps) ->
470
update_scorelist_2([], Score, N, SoundPid) when N < 10 ->
470
update_scorelist_2([], Score, N, _SoundPid) when N < 10 ->
471
471
[[integer_to_list(Score),getuser()]];
473
update_scorelist_2(_, _, N, SoundPid) when N >= 10 ->
473
update_scorelist_2(_, _, N, _SoundPid) when N >= 10 ->
476
476
update_scorelist_2([[Sc, Name] | Rest], Score, N, SoundPid) ->
483
483
lists:append([[integer_to_list(Score),getuser()]],
484
484
update_scorelist_3([[Sc,Name]|Rest],N+1));
486
486
lists:append([[Sc,Name]],update_scorelist_2(Rest, Score, N+1, SoundPid))
561
561
write_text(Fd, "", io:get_line(Fd, "")),
564
564
gs:config(aboutText, {text, "Error: could not read the about file"})
570
570
gs:destroy(aboutWin)
573
write_text(Fd, Text, eof) ->
573
write_text(_Fd, Text, eof) ->
574
574
gs:config(aboutText, {text, Text});
575
575
write_text(Fd, Text, More) ->
576
576
write_text(Fd, lists:append(Text, More), io:get_line(Fd, "")).