Board index » delphi » Simple game + TMediaplayer sound + TTimer

Simple game + TMediaplayer sound + TTimer

http://hf.gamepoint.net/Destruct.zip (game+sound+sounce @ 260 kb)

My problem is not really that serious. I made this simple game in delphi 5
to test the structure and see what methods were needed. Now that this test
version turned out pretty nice I want to make it perfect.
For the various sounds I use Tmediaplayers and "mediaplayer.play" them
whenever needed. I also use the TTimer as the gameloop. Roughly every half
second (depending on the level an number of lines left) a block spawns whith
a sound. This spawning/sound isn't always at the same interval (sometimes
400 ms between block, sometimes 600 ms estimate).
Is the TTimer stable enough for such a precise timing? Or is the fault with
the Tmediaplayer? What alternatives can I use (especially regarding the
mediaplayer.. there has to be a better way)?

Thanks in advance.

 

Re:Simple game + TMediaplayer sound + TTimer


Quote
> http://hf.gamepoint.net/Destruct.zip (game+sound+sounce @ 260 kb)

> My problem is not really that serious. I made this simple game in delphi 5
> to test the structure and see what methods were needed. Now that this test
> version turned out pretty nice I want to make it perfect.
> For the various sounds I use Tmediaplayers and "mediaplayer.play" them
> whenever needed. I also use the TTimer as the gameloop. Roughly every half
> second (depending on the level an number of lines left) a block spawns
whith
> a sound. This spawning/sound isn't always at the same interval (sometimes
> 400 ms between block, sometimes 600 ms estimate).
> Is the TTimer stable enough for such a precise timing? Or is the fault
with
> the Tmediaplayer? What alternatives can I use (especially regarding the
> mediaplayer.. there has to be a better way)?

You should probably look at the DelphiX components by Hori, they are a
collection of very easy-to-use Direct X components. Using Direct X gives
that extra "pro" look to a game :)

Get them at
http://www.yks.ne.jp/~hori/program-e.html
I'm sure you'll enjoy them, I do...

There's even a bunch of samples to be inspired by

- Show quoted text -

Quote
> Thanks in advance.

Re:Simple game + TMediaplayer sound + TTimer


Thank you. I will give it a try.

Other Threads