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 / Magic Text

Author
Message
Toxitalk
18
Years of Service
User Offline
Joined: 13th Feb 2006
Location:
Posted: 13th Feb 2006 21:30
While I was trying to develop my Space invaders game I came accross what to me is a bug. (unique feature if you will)

What happens is the spacebar triggers the text statement (putting the word fire on the screen).

What is puzzling me is why the text dissapears when I take my finger off the space key?

Any ideas?

Cheers

Mark.

Smoke me a kipper.....
Jerok
19
Years of Service
User Offline
Joined: 7th May 2005
Location: Mars. Wait a sec I\'m on MARS. OMG
Posted: 13th Feb 2006 22:21
the text command needs to be used every loop to keep the text on screen otherwise it will dissappear

RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 13th Feb 2006 22:24 Edited at: 13th Feb 2006 22:25
You're status is too new on these forums so the Source button wont work, put the code in the
tags in the actual message.

Im pretty sure that I know whats happening, and it's no bug with DBP but a bug with your code.

Im guessing your code is something like this;


The program is doing exactly what you're telling it, its only displaying "Fire" when SPACEKEY()=1. To bypass this, you can do a few things, probably the simplest would be to create a variable, maybe called Display, and set it to 1 when you want Fire to be displayed and 0 when you dont. So something like this;


Not sure why you'd want Fire to be displayed constantly on the screen, if you dont you can do a few things to remove the Fire from the screen again. First, you could use what you had when it displays Fire only when the spacekey is pressed, but since youre posting thats a problem you could maybe either set a different key to stop Fire from being displayed, or create a Timer using the Timer() command or your own custom function.

If this isnt the problem post your code in the code tags and we'll try to help some more.

Just so you know, to post in the code tags, put the code in the message, select it with the mouse and click the code button above the emoties at the top. Just a note Mozilla sometimes screws up when you click the code button by just putting a code tag at the very bottom of the message, if thats the case just manually type [ code ] before the code and [ /code ] after the code, without the spaces.

<EDIT>

Oh, the message above mine could be the problem too )

</EDIT>

Goodluck,
- RUC'

Toxitalk
18
Years of Service
User Offline
Joined: 13th Feb 2006
Location:
Posted: 14th Feb 2006 10:15
Cheers guys.

As for why I wanted to do it, I don't, it just crossed my mind as I was starting to develop my ideas for my game (I was using it to prove the spacebar detect had worked).

Cheers

Mark.

Smoke me a kipper.....

Login to post a reply

Server time is: 2024-09-24 15:36:25
Your offset time is: 2024-09-24 15:36:25