PDA

View Full Version : Downfall



peterbone
20-05-2004, 11:11 AM
This is a game I've been making based an a game I used to play on the Atari ST. Please copy and paste this link - don't click on it because geocities don't allow remote linking.
http://www.geocities.com/peter_bone_uk/Downfall.zip
Sorry if that link doesn't work - hopefully I'll upload it somewhere else soon.
It's a 2 player game. It would be good if I could make it into a game to play over the net - but I don't have the skills. You'll need to read the ReadMe file to learn how to play.

Peter Bone

peterbone
20-05-2004, 11:24 AM
http://atlas.walagata.com/w/peterbone/Downfall.zip

Traveler
20-05-2004, 03:41 PM
Say, that is really a cool game! It somehow reminded me a bit of lemmings. Don't ask me why though :roll: . Too bad there isn't a cpu playing against me. Are you planning on implementing this?
Anyway, heres a few things I noticed while playing.

- When I move the cursor all the way to the top, the screen starts to flicker.
- When I cut through a large pile of 'snow' (upwards) a line up black pixels went also upwards.

- A customize keys option would be nice 'cause I found the player1 keys a little bit uncomfortable to play with.
- Also a pause key may be handy

WiZz
20-05-2004, 04:16 PM
nice game, fun gameplay.

peterbone
20-05-2004, 08:41 PM
- When I move the cursor all the way to the top, the screen starts to flicker.

Yes, annoying isn't it. It happens because the cursors are transparent images and when they move over the edge of other components they cause flicker.

- When I cut through a large pile of 'snow' (upwards) a line up black pixels went also upwards.

That's the 'bubbles' moving up because you erased the line, so snow has to fill that space so snow moves down and bubbles move up - unless I'm thinking of something else.
There is a bug with the snow somewhere. Sometimes piled up snow doesn't fall when it should do after erasing a line. it only happens near the top of the screen and I can't work out what's causing it for the life of me.

I've thought of adding AI to play against but it would have a major advantage in control but I suppose I could slow it down or something.

Anyway, glad you like the idea.

Peter

Harry Hunt
22-05-2004, 06:48 AM
Yes, annoying isn't it. It happens because the cursors are transparent images and when they move over the edge of other components they cause flicker.


If you're using the canvas functions for your game (and I assume you do), draw the cursor on the canvas instead of moving components around and use double-buffering to avoid the flicker.
To draw an image with transparent areas onto a canvas do this:


Image1.Picture.Bitmap.Transparent := True;
Image1.Picture.Bitmap.TransparentColor := clRed;
Form1.Canvas.Draw(CursorX, CursorY, Image1.Picture.Bitmap);


and if you draw on an off-screen buffer (e.g. another TBitmap) first and then Blt that onto the form canvas it shouldn't flicker anymore.

peterbone
24-05-2004, 12:40 PM
OK thanks. I'll draw the cursor on the canvas and draw the 2 screens on seperate bitmaps before drawing them on the form. Will there be much reduction is speed if I draw them to an offscreen bitmap and then onto the screen? I'm not using DirectX or anything like that.

Also there's another problem with the game that I need help resolving. On some computers certain key combinations don't work at the same time(like Ctrl, up and right). I'm using GetKeyboardState. On different computers different key combinations don't work and on some computers there's no problem. Is the problem with the keyboard driver, or the keyboard, or what?

thanks

Peter

Harry Hunt
24-05-2004, 03:24 PM
Drawing on an off-screen buffer won't make your game slower. It will use more memory but that's about it.
As for the key thing: I blieve this is a windows problem. I'm not absolutey sure though. You can bypass this by allowing the user to customize the controls. :wink:
I dunno if DirectInput would fix your problem, but you could try that.

peterbone
26-05-2004, 02:55 PM
I did the graphics improvements you suggested and the screens no longer flicker. :D
http://atlas.walagata.com/w/peterbone/Downfall.zip
However, the cursors still flash on and off using the transparent bitmap and draw method you suggested above. I even tried using a mask with the CopyMode method but that made no difference.

Peter

peterbone
26-05-2004, 03:13 PM
Also, I want to add customizable controls as you suggested, but what's the best way to do the interface for that? I could have a combobox with all the keys in for each control. Or another way is it could ask you to press the corresponding key for each control in turn.

Peter

Harry Hunt
27-05-2004, 08:06 AM
I wrote a small program to illustrate how to do non flickering transparent cursors and custom keys. Check it out. If there's something you don't understand, let me know.

http://public.xcessred.com/stuff.zip

peterbone
27-05-2004, 02:25 PM
Thanks for the code.
Downfall now has no flicker and customizable controls.
http://atlas.walagata.com/w/peterbone/Downfall.zip
You can set the controls to be the same and play on both screens at the same time!

I know your code was just a simple demo but I found that I needed to add this

procedure TControlsForm.FormHide(Sender: TObject);
begin
if not Timer1.Enabled then Exit;
ControlsForm.StringGrid1.Cells[CellX, CellY] := Selection;
ControlsForm.Timer1.Enabled := False;
UnHookWindowsHookEx(KeyBoardHook);
end;
incase the user closes the form while a cell is still flashing.

Thanks again

Peter

Harry Hunt
27-05-2004, 04:23 PM
yeah, there are a bunch of things that could be improved...