![]() |
|
[MinorHack] The saga continues |
Kibiz0r
Member #6,203
September 2005
![]() |
Open up a command prompt, cd to the directory, type make, or mingw32-make if that doesn't work. If that doesn't work, don't even bother, you have something messed up and it'll take longer than the convenience it gives you in the first place. --- |
BAF
Member #2,981
December 2002
![]() |
Run make. In order of ranking: BAF - best game ever Of course, I ranked the completed entries ahead, wether or not I thought the product itself was better just because they finished. I wouldn't have changed much by not ranking that way. [edit] |
Simon Parzer
Member #3,330
March 2003
![]() |
Quote: Simon - you forgot END_OF_MAIN so i couldn't compile it without fixing, is incomplete, otherwise nice start
Oh, my.. Ranking °°°°°°° 1. JakubWasilewski]- nice and complete game, feels very polished (fadeouts, etc.) 2. BAF]- nice pong clone, paddles are a tad too small 3. Kikaru]- looks like a fun game, but runs too fast; crashes sometimes, too (had to type "killall Kikaru" a few times :P 4. Zaphos]- nice snake/worms/nibbles/whatever clone; runs too slow, level design makes no sense to me 5. CGamesPlay]- useless, but the movement and rotating of the ship looks great 6. GrantG]- your breakout clone doesn't make much sense because there is no wall to destroy (yet?) 7. Onewing]- the display is not very accurate (I know of better ASCII viewers); besides that, it's not a game 8. Kibiz0r]- crashes everytime I click, sorry
|
Jakub Wasilewski
Member #3,653
June 2003
![]() |
I did mention the box is space in the instructions. At least I did mention that space is needed Anyway, the re-revised version (attached again, sorry ML) has a bug fixed where the time didn't stop after you enter all 6 symbols. I had if (where != 6); timeLeft -= 0.01;. One sodding semicolon... --------------------------- |
Zaphos
Member #1,468
August 2001
|
Quote: Zaphos - if it's the same error I got, just add END_OF_MAIN() at the end. Ah -- yeah, that was it, thanks!
|
CGamesPlay
Member #2,559
July 2002
![]() |
Yes, well you probably have a winalleg.h Jakub: Cool game! It would be perfect if it had an option to restart without quitting, but it's great as is. Onewing: I can't play it. I don't actually have any bitmaps sized 80 or less. So! Jakub, Zaphos, Kikaru, Simon, GrantG, BAF, Kibiz0r, Onewing. I won't call my ranking final yet until Onewing offers something in his defense... [append] -- Ryan Patterson - <http://cgamesplay.com/> |
BAF
Member #2,981
December 2002
![]() |
I didn't take off for it, but I didn't see space mentioned anyplace (I probably didn't read carefully enough) until I checked the source. |
Kibiz0r
Member #6,203
September 2005
![]() |
makefile said: The following entries failed to compile: SimonParzer.exe
--- |
BAF
Member #2,981
December 2002
![]() |
For the third time, he forgot END_OF_MAIN() after main, so you have to add it yourself. |
Jakub Wasilewski
Member #3,653
June 2003
![]() |
The new revised version has an option to restart instead of quitting Quote: I didn't take off for it, but I didn't see space mentioned anyplace (I probably didn't read carefully enough) until I checked the source.
Even if you did lower your score because of it, it's your right. If someone isn't clear about the game rules, it's always the creator's fault - even if it is on the screen, perhaps it's not drawing attention to itself enough Anyway, I distinctly remember wasting 20 seconds to add a line mentioning the keys --------------------------- |
CGamesPlay
Member #2,559
July 2002
![]() |
Jakub: can you put together a zip file with the windows binaries? Then drop by the administration page. -- Ryan Patterson - <http://cgamesplay.com/> |
Kibiz0r
Member #6,203
September 2005
![]() |
There's too much text in this thread, it got lost in the ASCII blizzard. --- |
Simon Parzer
Member #3,330
March 2003
![]() |
Quote:
There's too much text in this thread, it got lost in the ASCII blizzard. Yeah, everytime I hit F5 there are 2-5 new posts. shudders |
Onewing
Member #6,152
August 2005
![]() |
Quote: I won't call my ranking final yet until Onewing offers something in his defense... Fair enough! User friendly-ness isn't something I think of when in a coding frenzy. A simple stretch sprite allows you to throw any image in: (just use this code) 1// Entry for MinorHack at March 17th
2// Submitted by Onewing
3// Compile with allegro!
4#include "allegro.h"
5#include<stdio.h>
6#include<string.h>
7#include<math.h>
8
9/**************** DEFINES & MACROS *************/
10#define BPP 32
11#define MODE GFX_AUTODETECT_WINDOWED
12#define GFX_W 640
13#define GFX_H 480
14#define MAX_BLOCKS 1000
15
16/*************** CONSTANTS ********************/
17#define MASK makecol(255,0,255)
18
19/*************** GLOBAL ********************/
20volatile int system_time;
21volatile int ticks;
22volatile int framerate;
23volatile int draw_ticks;
24PALETTE pal;
25COLOR_MAP trans_table;
26BITMAP *buffer;
27
28int iTimer_Speed;
29int iFrameRate;
30int quit;
31int over;
32
33#define MAX_ROW 60
34#define MAX_COLUMN 80
35
36void timer1(void)
37{
38 system_time++;
39}END_OF_FUNCTION(timer1);
40
41void frametimer(void)
42{
43 framerate = draw_ticks;
44 draw_ticks = 0;
45}END_OF_FUNCTION(frametimer);
46
47
48
49void init()
50{
51 // Allegro Library
52 if(allegro_init() != 0)
53 {
54 allegro_message("ERROR: Failed to initialize allegro library. Terminating program.\n");
55 allegro_message("REPORT: %s\n", allegro_error);
56 exit(0);
57 }
58
59
60 set_color_depth(BPP) ; // 24 bit colour
61 if (set_gfx_mode(MODE, GFX_W, GFX_H, 0, 0)<0)
62 {
63 set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
64 allegro_message("ERROR: Failure to init video mode! Terminating program.\n");
65 allegro_message("REPORT: %s\n", allegro_error);
66 exit(0);
67 }
68
69
70 // Install Timer
71 if(install_timer() != 0)
72 {
73 set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
74 allegro_message("ERROR: Failed to install timer. Terminating program.\n");
75 allegro_message("REPORT: %s\n", allegro_error);
76 exit(0);
77 }
78
79
80
81 // Install Keyboard
82 if(install_keyboard() != 0)
83 {
84 set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
85 allegro_message("ERROR: Failed to install keyboard. Terminating program.\n");
86 allegro_message("REPORT: %s\n", allegro_error);
87 exit(0);
88 }
89
90 /*install_joystick(JOY_TYPE_AUTODETECT);
91 poll_joystick();
92 if(num_joysticks == 0)
93 {
94 allegro_message("NOTE: No joystick could be found, but you can still use keyboard.");
95 }
96 startpos = joy[0].stick[0].axis[0].pos;*/
97
98
99 // Install Mouse
100 if(install_mouse() < 0)
101 {
102 set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
103 allegro_message("ERROR: Failed to install mouse. Terminating program.\n");
104 allegro_message("REPORT: %s\n", allegro_error);
105 exit(0);
106 }
107
108 text_mode(MASK);
109 reserve_voices(32,-1); ///Reserves more channels of sound for us
110
111 // Install Sound
112 if(install_sound(DIGI_AUTODETECT, MIDI_NONE, NULL) != 0)
113 {
114 allegro_message("ERROR: Failure to install sound. Attempting to run without sound.\n");
115 allegro_message("REPORT: %s\n", allegro_error);
116 if(install_sound(DIGI_NONE, MIDI_NONE, NULL) != 0)
117 {
118 allegro_message("ERROR: Failed to install sound. Terminating program.\n");
119 allegro_message("REPORT: %s\n", allegro_error);
120 exit(0);
121 }
122 }
123
124 srand( (unsigned) time(NULL));
125
126 // Install Time Handler
127 LOCK_VARIABLE(system_time);
128 LOCK_VARIABLE(ticks);
129 LOCK_VARIABLE(framerate);
130 LOCK_VARIABLE(draw_ticks);
131 LOCK_FUNCTION(timer1);
132 LOCK_FUNCTION(frametimer);
133 iTimer_Speed = 60;
134 install_int_ex(timer1, BPS_TO_TIMER(iTimer_Speed));
135 install_int_ex(frametimer, BPS_TO_TIMER(1));
136 //install_int(timer1, 1000);
137
138 // Setup the buffer
139 buffer = create_bitmap(GFX_W, GFX_H);
140
141 // Setup translucent table
142 create_trans_table(&trans_table, pal, 0, 0, 0, NULL);
143 color_map = &trans_table;
144}
145
146//**************** Classes ***********************
147
148int red(int color_value)
149{
150 return int(color_value / pow(256, 2)) % 256;
151}
152int green(int color_value)
153{
154 return int(color_value / pow(256, 1)) % 256;
155}
156int blue(int color_value)
157{
158 return color_value % 256;
159}
160
161class TEXTS
162{
163public:
164 char c;
165 int col;
166};
167
168TEXTS txt[100][100];
169
170int game_init(char *cpath)
171{
172 BITMAP *bImage, *bS;
173 int col, colr, colg, colb, v;
174
175 bImage = load_bitmap(cpath, NULL);
176 if(!bImage)
177 {
178 allegro_message("Could not open %s", cpath);
179 return 1;
180 }
181
182 bS = create_bitmap(100, 100);
183 stretch_sprite(bS, bImage, 0, 0, 100, 100);
184
185 for(int i = 0; i < 100; i++)
186 {
187 for(int j = 0; j < 100; j++)
188 {
189 txt<i>[j].c = ' ';
190 txt<i>[j].col = 0;
191 }
192 }
193 for(int x = 0; x < bS->w; x++)
194 {
195 for(int y = 0; y < bS->h; y++)
196 {
197 col = getpixel(bS, x, y);
198 colr = getr(col);
199 colg = getg(col);
200 colb = getb(col);
201
202 v = colr + colg + colb;
203 if(v < 100)
204 txt[x][y].c = '#';
205 if(v >= 100 && v < 200)
206 txt[x][y].c = 'X';
207 if(v >= 200 && v < 300)
208 txt[x][y].c = 'P';
209 if(v >= 300 && v < 400)
210 txt[x][y].c = 'C';
211 if(v >= 400 && v < 500)
212 txt[x][y].c = '+';
213 if(v >= 500 && v < 600)
214 txt[x][y].c = '-';
215 if(v >= 600 && v < 700)
216 txt[x][y].c = ',';
217 if(v >= 700 && v < 800)
218 txt[x][y].c = '.';
219 txt[x][y].col = col;
220 }
221 }
222 destroy_bitmap(bImage);
223 destroy_bitmap(bS);
224
225 return 0;
226}
227
228void game_update()
229{
230 if(key[KEY_ENTER])
231 {
232 while(key[KEY_ENTER]){}
233 over = true;
234 }
235
236}
237
238void game_draw()
239{
240 clear(buffer);
241
242 for(int x = 0; x < 100; x++)
243 {
244 for(int y = 0; y < 100; y++)
245 {
246 textprintf_ex(buffer, font, x*8, y*8, txt[x][y].col, -1, "%c", txt[x][y].c);
247 }
248 }
249 textprintf_ex(buffer, font, 200, 470, makecol(255, 255, 255), -1, "Press ENTER to go to the next image");
250 stretch_sprite(screen, buffer, 0, 0, GFX_W, GFX_H);
251}
252
253void game_shutdown()
254{
255 destroy_bitmap(buffer);
256}
257
258
259
260void play_game(char *cpath)
261{
262 iFrameRate = false;
263 if(game_init(cpath) != 0)
264 return;
265
266 while(!quit)
267 {
268 while(!key[KEY_ESC] && !over)
269 {
270 while(system_time && !over)
271 {
272 system_time--;
273 ticks++;
274 game_update();
275 }
276
277 draw_ticks++;
278 game_draw();
279
280 if(iFrameRate) textprintf(screen, font, 10, 10, -1, "%d", framerate);
281 }
282 quit = true;
283 system_time = 0;
284 ticks = 0;
285 }
286
287}
288
289
290
291int main(int argc, char **argv)
292{
293 init();
294
295 if(argc < 2)
296 {
297 allegro_message("Please enter the path(s) of a bitmap image on the command line.");
298 exit(0);
299 }
300
301 for(int i = 1; i < argc; i++)
302 {
303 over = false;
304 quit = false;
305 play_game(argv<i>);
306 }
307
308 game_shutdown();
309
310 return 0;
311}
312END_OF_MAIN()
------------ |
CGamesPlay
Member #2,559
July 2002
![]() |
Kibiz0r: the new entry is much better. I rank it above BAF's, for the "revised" competition, which doesn't exist -- Ryan Patterson - <http://cgamesplay.com/> |
Jakub Wasilewski
Member #3,653
June 2003
![]() |
Quote: Jakub: can you put together a zip file with the windows binaries? Then drop by the administration page.
Done. Not sure if it did anything though --------------------------- |
Kibiz0r
Member #6,203
September 2005
![]() |
Quote:
Kibiz0r: the new entry is much better. I rank it above BAF's, for the "revised" competition, which doesn't exist Well, now that I know there is an easy way to do deletion in a for loop for std::lists, I will do much better next time. --- |
BAF
Member #2,981
December 2002
![]() |
Windows exe zip pack attached. |
Jakub Wasilewski
Member #3,653
June 2003
![]() |
Anyway, I've got level 14 in my game (the revised version, which is easier because it stops the time once you enter everything). Now, beat me --------------------------- |
CGamesPlay
Member #2,559
July 2002
![]() |
Well, zip file downloading or uploading seems to be broken. I don't know how to store them or load them from the database... -- Ryan Patterson - <http://cgamesplay.com/> |
Kibiz0r
Member #6,203
September 2005
![]() |
Quote:
Anyway, I've got level 14 in my game (the revised version, which is easier because it stops the time once you enter everything). Now, beat me I got 10 the first time I played it, it's quite fun. And pretty. my sticky note said: BAF: Pong remake, well done CGamesPlay: Asteroids with neat-o movement and nice graphics GrantG: Breakout clone that moves too fast with impossible-to-see blue paddle and nothing to obliterate? Jakub Wasilewski: Awesome DDR-style game -- fun to play with neat graphics, got to level 10! Kikaru: A bit broken, too fast, and confusing as hell... but somehow still fun for the brief time that the stars are aligned properly Onewing: It's not really a game, but... it's a cool tech demo, I have no idea how to rank it yet Simon Parzer: Er, uh... you can't really "do" anything.... it looks neat, though... Zaphos: Flawless Snake clone with a little twist. Great pacing and difficulty, I could imagine playing it on my cell phone!
Still not sure about rankings, but feedback is always nice, eh? --- |
CGamesPlay
Member #2,559
July 2002
![]() |
Okay, it's working now. Feast your eyes. Kibiz0r: are those sorted form least favorite to favorite? -- Ryan Patterson - <http://cgamesplay.com/> |
Kikaru
Member #7,616
August 2006
![]() |
Ok, my vote, in order:
|
BAF
Member #2,981
December 2002
![]() |
|
Jakub Wasilewski
Member #3,653
June 2003
![]() |
My ranking:
--------------------------- |
|
|