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 Professional Discussion / Simple RPG script

Author
Message
Bellator Quest 3d
15
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 8th Mar 2011 02:55
Hey guys, my friend just gave me a copy of your product for my birthday. I checked it out, and i love it. Love how you just have to write one line of code to get what would take 20 lines of code in other languages (C, C++, Java, etc.)

Now i have this code, i have made several other games, and am making a small battle system, where the player presses space while theyre touching the npc, and the npc takes damage. I have made the system fine, except that you can hold down space, and the fight will and SUPER fast. I want to make it so when you press space, the damages for the player and enemy are displayed, until you press it again, and once you press it again, it updates that info. Heres the code for the part for combat. Just expect all my variables to be in there . If you want the full code, ill do it, but this post is already long enough.



I know how the wait ... code works, but i dont know where to put it in there to do what i want it to do.
Also, dont worry about any beginner crap i have, I just want to worry about how to get the above to work. Dont try and fix something thats not broken.

Bellator Quest 3d: Small RPG Under Development (looking for team *hint hint*) Plan on turning into MMoRPG once finished
Wyldhunt
16
Years of Service
User Offline
Joined: 27th Sep 2009
Location: The Dark Side
Posted: 8th Mar 2011 06:24
What you need is a variable that you can update to track the spacebar state.
I'm not at my DBP computer, so I can't test. This should give you a basic idea of what you're looking at though. By adding in a CombatUpdate variable, the code will only run one time each time the spacebar is pressed.

Bellator Quest 3d
15
Years of Service
User Offline
Joined: 7th Mar 2011
Location:
Posted: 8th Mar 2011 23:42
okay... That makes sense. Wonder why I didnt use that before, i always used to use that in Java...

Bellator Quest 3d: Small RPG Under Development (looking for team *hint hint*) Plan on turning into MMoRPG once finished

Login to post a reply

Server time is: 2026-07-15 03:40:12
Your offset time is: 2026-07-15 03:40:12