My first game posted


The previous thread must have locked. I can't add to it. In any case I was able to download, unzip, and run on a borrowed laptop. I didn't even need to log in

However, I've had luck uploading here. Let me know if this doesn't work for you. The post doesn't show the game, you have to click on the paperclip in this post. I can also upload the source code it anyone is interested.

Thanks again for looking,

Edgar Reynaldo

Attachments and images are working again. THANKS MATTHEW!!!!




Thanks Matthew. Thanks Edgar for the images.

Edgar Reynaldo

Pesky dragon cornered me. Usu. it appears right next to me though. :/

Difficult, but enjoyable. I wish it accepted keyboard input a little faster though.


Thanks for the input Edgar. I had the dragon appear at random. It can appear close at times. Also as the code is, you can run into him before he awakes.

Probably before your time but the original board game he appeared in the treasure room once awoken. You still didn’t know where that was exactly,only that it was within the 3 block radius. You used a board piece to represent where you thought he was and moved him and you accordingly. I couldn’t really duplicate that. If I had him surface at the treasure, it would make the game too easy. Just lure him away and go get it. You do move 6 to his 1. So I opted for this way.

Also in the original he could move diagonal. I thought that made it too difficult.

Thanks again. Now that I can upload, I’ll load the source later tonight.

EDIT: as for the slow keys. Could just be improper keyboard set up on my part. I also put a couple clear key buffer and possibly a slight delay. In the beginning it was reading keys faster than I could remove finger causing the player to continue in a direction further than desired. I’m sure weak code.

Added Source code


The previous thread must have locked. I can't add to it.

It's not locked. You just can't add to it as you're the last person to post in it and the forum doesn't allow double posting.


You’re right. I should have edited my last entry like I have here. I’m sure why that didn’t occur to me. Thx for the heads up.

Edgar Reynaldo

Ace, the problem with polling is that you're only looking at key states, (UP / DOWN) not state transitions (PRESS / RELEASE / HOLD / OPEN).

If you wanted to use my EagleClassic library it works with Allegro 4. It has all kinds of goodies for input.

For example, take a look at this :


Thx for the heads up Edgar. I'll check it out. So this is a flaw with polling vs event driven? Just curious.

Edgar Reynaldo

The flaw with polling is that you miss state changes in between poll updates.

You can simulate event based with polling, but it still suffers the same problem.

Event based allows you to know the current state at any given time. It is vastly superior when available.

However, Allegro 4 has a key buffer for this very purpose. readkey blocks until a key is in the key buffer.

For example, suppose you had the following code, and mrest rests exactly that many milliseconds :

Polling, Allegro 4

while (!key[KEY_SPACE]) {
   mrest(250);/// 250 ms is exagerrating, but with an allegro timer
              /// set to 60HZ, you still rest approximately 16ms per frame

It might catch the space bar press, it might not. key[KEY_SPACE] is volatile, and changes based on Allegro's update thread. key[KEY_SPACE] could be false entering the loop, be pressed and released, and be false again before mrest(N) completes.

Key buffer, Allegro 4

do {
   key = readkey() >> 8;
} while (key != KEY_SPACE);

It exits immediately as soon as the space bar is pressed.

Allegro 5 key detection

do {
   al_wait_for_event(queue , &ev);
   if (ev.type == ALLEGRO_EVENT_KEY_DOWN && ev.keyboard.keycode == ALLEGRO_KEY_SPACE) {break;}
} while (!al_is_event_queue_empty(queue));


Edgar, I do something similar in the game. The loop aspect is handled by the calling function

key_press = readkey();
key_press = key_press>>8;

if(key_press == KEY_LEFT )
if (key_press == KEY_UP)
if(key_press == KEY_RIGHT)
if(key_press == KEY_DOWN)
if(key_press == KEY_Q)
if(key_press == KEY_ENTER)

Other than an occasional overrun of a direction, it does fair. However, I was trying to work out the logic of a baseball program. It waited on a key hit. Then depending on the timer status I gave a result. Late hit, opposite field, early hit, a pulled ball. If it doesn't fall within a given range, a negative result, strike, foul ball etc. In any case, it was then I seen the deficiency with Allegro 4 polling. To this point every program I've written just stopped and waited on user. (board game type games) but with the baseball game, when doing something while waiting, the polling can skip or react at differently each time, causing issues in the game.

I think I'm going to look at the Eagle lib, but most likely will graduate on to Allegro 5.

I checked out your Missile defense page. I used to have a 286 years ago. I had a 8086 prior to that. A IBM Microchannel. I have kept my IBM P70 luggable 386 with a 387 mathcoprocessor. Has 40 meg hard drive and 4 meg of ram. You'll have to Google it ;D. In any case I liked Missile Command as well. Remember playing it in the arcade. I tell you those Atari games with the track ball were a blast.

but I digress. thanks for the info.

Edgar Reynaldo

EagleClassic works with Allegro 4, but Eagle works with Allegro 5, and eventually will have an Allegro 4 driver.

Also, the missile defense I have up on my member website is way out of date, and slightly buggy. I've been working on a new version called Skyline.

Try 2e, it's my latest release

LMB and RMB control firing. ESC quits.



I checked out Skyline 2E. Pretty cool. The graphics and fluidity was awesome. I especially like the shield over the city. It reminds me of GORF. I have a Intellivision game called Atlantis. It’s a Missile Command variant except the cities are under water. It has shields over each city.

I liked the game play as well. The only game play difficulty I seen was the missile response was slower than I expected so my timing was off. I’m sure that would be something you could adjust to as you got more familiar with the game. Plus I was trying while at work so my attention and time was limited. ;D.

In any case it’s a well put together game. Have you had many hits with it?

I was also curious why you didn't use grabber to construct a single data file. Just personal preference or a functional issue. Lastly, is there a title screen in the works or not so much?

Edgar Reynaldo

Thank you for the feedback!

Yeah, I haven't worked on it in like 6 months. And my website is out of date too. I've just been working on tons of other things. It's still on my radar.

Yeah, the game is meant to be fully configurable, and extendable with any city skyline image in the right format. Did you look at the config file? There are a ton of options you can adjust in there.

Well, I wouldn't use grabber as that is allegro 4. I would use PhysFS and a .7z instead because Skyline was the Allegro 5 remake of my previous game.

Thread #617911. Printed from