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.

DarkBASIC Discussion / stopping objects

Author
Message
kRx
20
Years of Service
User Offline
Joined: 2nd Apr 2005
Location: Canterbury, Kent, UK
Posted: 30th May 2005 08:52
when u have an existing 'ifupkey()' etc code is there a way to stop an object moving forward/backward by stopping the upkey() code when something is happening for example if a rpg text box is on screen?

thanks in advance

kR

kR
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 30th May 2005 10:11
kRx,

I believe this will answer your question. Wrap the line if upkey() = 1 then move object ... in a single if statement like below.



Where textbox is a boolean variable which should be set to either 0 or 1. So, when the text box is activated within your program, then set the variable textbox to 1. When the text box is deactivated, then set textbox to 0. In this end, only the object will move when there is not textbox on the screen.


+NanoBrain+
EddieB
20
Years of Service
User Offline
Joined: 29th Sep 2004
Location: United Kingdom
Posted: 30th May 2005 19:45
Or you could do this:

kRx
20
Years of Service
User Offline
Joined: 2nd Apr 2005
Location: Canterbury, Kent, UK
Posted: 30th May 2005 21:32
LEGENDS!! worked perfectly and i was trying way more complicated stuff. thanks a lot guys!

im off for some to celebrate

kR

kR

Login to post a reply

Server time is: 2025-05-23 02:08:35
Your offset time is: 2025-05-23 02:08:35