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 / key press thing...

Author
Message
D I G I T A L
21
Years of Service
User Offline
Joined: 22nd Jun 2003
Location: Dubai, UAE
Posted: 31st Oct 2003 02:05
hello people,
here's my problem. my game has two kinds of weapons, when i press 1 (Scancode()=2) then it loads the bullets for the weapon selected, when i press 2 (scancode()=3) it loads another type of bullets, here's my problem:
my bullets cannot be selected unless i keep holding the keys (1,2) i just need to select my weapon by just pressing the key, and not holding it.

here's a code to make it clear:

if scancode()=2
load weapon1
load bullets for weapon1
endif

if scancode()=3
load weapon2
load bullets for weapon2
endif

thannkx for advance

‘Those who ignore the lessons of the past are doomed to repeat them’ (Napoleon)
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 31st Oct 2003 08:27 Edited at: 31st Oct 2003 08:28
Hmm, that should work (but it depends on your actual codeing)

Try doing this:



Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
FROGGIE!
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: in front of my computer
Posted: 31st Oct 2003 15:10
Also swap the SCANCODE() command for the KEYSTATE() command. This lets you change weapons while pressing another button.

Login to post a reply

Server time is: 2025-05-21 09:30:59
Your offset time is: 2025-05-21 09:30:59