Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Emulating a ECG

Author
Message
chicken man
17
Years of Service
User Offline
Joined: 5th Jun 2007
Location:
Posted: 5th Jun 2007 18:51
Ok so here is the idea, I want to emulate the output of a ECG on part of the screen (for a game I am making), if you do not know what a ECG is look here

The problem is I do not know how to do this, so any ideas would be very helpful.

Also does anyone know how to make a function call every X milliseconds ?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 5th Jun 2007 19:13
Quote: "Also does anyone know how to make a function call every X milliseconds ? "


You either have to do it manually using a timer variable, or there is a function is the Styx Plugin that allows it.

chicken man
17
Years of Service
User Offline
Joined: 5th Jun 2007
Location:
Posted: 5th Jun 2007 20:30
Hmmm timer, I've always had problems with that.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 5th Jun 2007 22:14
OK - not being particularly familiar with DBPro, I just wrote a quick program to do what you wanted in DBC - thinking it would take a few seconds to convert it to DBPro...

How wrong could I be!

First of all, I can't figure out how to draw a box without anti-aliasing in DBP.

Ink RGB(255,0,0),0
Box 10,10,100,100


in DBC works fine and you get a solid red box, but in DBP, the same code results in the red box having a single pixel dark red border around it.

Must be simple to do, so how do you turn it off?

I can post the working DBC version if it's of any help BTW...

TDK_Man

Twinsen
18
Years of Service
User Offline
Joined: 20th Jun 2006
Location: Romania
Posted: 5th Jun 2007 23:12
lol it's so simple ... in the main loop, make a variable called TIMER and make it increment by 1 every iteration ... now u have a timer ... now u can make a condition like this :

IF TIMER > 10000 ( or whatever )
do what u want to do
TIMER=0
ENDIF

Could you help me treat my injured Dino-Fly ?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 5th Jun 2007 23:44
If you want a consistent real-time timer you need to be alittle more detailed with your code, here it is for 500 milliseconds:



chicken man
17
Years of Service
User Offline
Joined: 5th Jun 2007
Location:
Posted: 5th Jun 2007 23:51
This works fine for me:
ink rgb(255,0,0),0
box 10,10,100,100

That kind of timer would do for most people but I need a more exact one.

The best I've got so far is drawing a slightly bumpy wave that repeats across the screen.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 7th Jun 2007 08:10
Here's the DBC version - haven't got time to convert it to DBP.

If you've got DBC you cab convert it yourself.



TDK_Man

Login to post a reply

Server time is: 2024-11-25 17:44:50
Your offset time is: 2024-11-25 17:44:50