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 / Quick question

Author
Message
Garfield1983
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location:
Posted: 14th Mar 2003 02:47
I'm trying to make a simple Bomber game (y'all remember Bomber right?)

Well the problem I have is with dropping the bomb -

I've used the If spacekey()=1 command to check if the spacekey is being pressed then drop the bomb.

The obvious problem with this is that the bomb only 'drops' while the spacekey is being held down.

I tried creating a variable called bombDropped and setting its value to 1 after the line of code above checks that space has been pressed. I then used an if statement to check if bombDropped=1 and if it did then drop the bomb..

However the problem is still the same. Any suggestions? I know its probably something really simple!=S Thanks
PiratSS
22
Years of Service
User Offline
Joined: 18th Oct 2002
Location:
Posted: 14th Mar 2003 08:20
Confused

Isn't the bomb suppose to drop when spacekey was pressed? If you can explain it just a bit, I am sure it is something simple.

Cheers.


Toughest line of codecol$=asc(left(Pcol$)),1+str$(rev)+chr(80)+left(right(mid(name$),1),1)
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 14th Mar 2003 08:41
I'm not sure how exactly you did the variable thing. But, it should look something like this:



If you don't have the 2nd If statement then it will always reset dropping the bomb. Alternatively, if this is your problem, you can just use the "GetKey()" function instead of the SpaceKey one.

"Computers are useless they can only give you answers."
Danmatsuma
21
Years of Service
User Offline
Joined: 2nd Mar 2003
Location: Australia
Posted: 14th Mar 2003 09:54
hmm better clarify that:



got it?

ZX Spectrum 48k Issue 3, Radio shack Tape drive, Rank arena 12" T.V. set.
Garfield1983
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location:
Posted: 14th Mar 2003 12:05
Yeah thats great thanks, ill try that now. It probably is that the second If statement is needed to stop it resetting. Yeah PiratSS, the bomb is supposed to drop when Spacekey is pressed (once). Cheers all.
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 14th Mar 2003 12:29
Danmatsuma - Yeah, that way works just as good too

"Computers are useless they can only give you answers."
Danmatsuma
21
Years of Service
User Offline
Joined: 2nd Mar 2003
Location: Australia
Posted: 14th Mar 2003 14:01
exeat, just you forgot the resetting bombdrop to 0, that code of yours would only have dropped one bomb, effectively "jamming" the mechanism afterwards... Be cool maybe to do that deliberately sometimes though ie..


ZX Spectrum 48k Issue 3, Radio shack Tape drive, Rank arena 12" T.V. set.
Danmatsuma
21
Years of Service
User Offline
Joined: 2nd Mar 2003
Location: Australia
Posted: 14th Mar 2003 14:04
SHIZER!!! stoopid typo that won't work, this will




ZX Spectrum 48k Issue 3, Radio shack Tape drive, Rank arena 12" T.V. set.
Danmatsuma
21
Years of Service
User Offline
Joined: 2nd Mar 2003
Location: Australia
Posted: 14th Mar 2003 14:34
Even better than that



ZX Spectrum 48k Issue 3, Radio shack Tape drive, Rank arena 12" T.V. set.
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 15th Mar 2003 08:45
Well once the bomb has exploded (in a collision sub) then would be the time to reset the bomb to 0, I didn't think I had to mention that lol. Unless you want to drop multiple bombs at the same time, in which you'd need a counter of some sort to reset it after the time is up.

"Computers are useless they can only give you answers."
Danmatsuma
21
Years of Service
User Offline
Joined: 2nd Mar 2003
Location: Australia
Posted: 15th Mar 2003 09:06
Didn't mean to tread on any toes, just thought that if he couldn't work out how to get a bomb to drop he might've not thought of that either...

ZX Spectrum 48k Issue 3, Radio shack Tape drive, Rank arena 12" T.V. set.
Garfield1983
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location:
Posted: 18th Mar 2003 02:36
Lol, yeah I had thought of that, but thanks for being thorough=)

Anyway, in the old bomber i used to play you couldn't drop another bomb til the last one had exploded, like Exeat said.

Thanks all=)

Login to post a reply

Server time is: 2024-11-24 06:01:13
Your offset time is: 2024-11-24 06:01:13